angularjs如何在视图渲染结束之后,或者render之后执行指令中的link方法
关键字:
$timeout
app.directive("myDirective",function($timeout){ return{ restrict:"A", link:function(scope,element,attrs,accordionController){ $timeout(function(){ element.click(function(){ alert("hello); }); },0); } } });
时间: 2024-10-24 11:54:40