angularjs如何在视图渲染结束之后,或者render之后执行指令中的link方法呢?

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);
}
}
});
上一篇:Hama学习总结


下一篇:Memcached Java Client API详解