新しいスコープを作成するためにトランスクルージョンでディレクティブを防ぐ方法は?
このjsfiddleは、赤い境界線で示されている新しいスコープのため、何もバインドできません。
HTML:
<div ng-app="components">
<input ng-model="var">
<block>
123
<input ng-model="var">
</block>
</div>
JavaScript:
angular.module('components', []).directive('block',function(){
return{
scope:false,
replace:true,
restrict:"E",
transclude:true,
template:'<div class="block" ng-transclude></div>',
link:function(scope, el, attrs, ctrl){
}
}
});
CSS:
.ng-scope{
border:1px solid red;
margin:10px;
}