0
我有一大堆的地方,我需要NG-顯示添加到要隱藏的元素。它可以從代碼中的一個位置完成嗎?熱做NG-顯示沒有屬性
所以不是這個模板:
<tr my-row ng-show="$ctrl.model.toShow()"></tr>
它應該是:
<tr my-row ></tr>
,然後在指令:
function myRow(){
return {
restrict: 'A',
templateUrl: 'my-row.html',
..
link = function(scope,el,attrs){
scope.$watch('modle.toShow', function(){
//something here?
})
}
};
}
增加了plunker,請檢查。 – Sravan
謝謝!!!!!! – user656449