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