且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何访问angularjs指令中链接函数内函数的作用域?

更新时间:2021-09-08 01:47:21

如果您需要准备好 DOM,您可以在链接函数中执行此操作(范围将是可访问的):

If you need the DOM to be ready you can do this inside the link function (the scope will be accessible):

$timeout(function(){
    alert('DOM ready');
    //** scope accessible here **
});