應用我有一個template.html指令,由包括NG-包括,在這個指令我改變的範圍,但它不是我的觀點改變範圍變更不是針對
這裏是我的html
<div ng-controller="myCtrl">
<div id="modal">
<div ng-show="showDIv">Somthing to controll</div>
</div>
<div ng-include src="template.html">
</div>
這裏是我的模板
<a ng-support></a>
這裏是我的指令
app.directive('ngSupport', function(){
return {
restrict: 'A',
link: function(scope, elem, attr, ctrl) {
elem.bind('click', function(e) {
$("#modal").dialog({height:518,width:900,modal:true });
scope.showDiv = true;
scope.$apply();
});
}
};
});
當我改變指令的範圍它不適用於視圖,任何人都可以幫忙嗎?
'showDIv'與'showDiv'(注意外殼)在這裏還是在你的代碼中有一個錯字? –