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);
        }
    }
});                

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2021-10-12
  • 2022-02-05
  • 2022-12-23
  • 2021-07-10
猜你喜欢
  • 2021-06-04
  • 2021-06-27
  • 2022-12-23
  • 2021-05-22
  • 2021-12-17
相关资源
相似解决方案