Run Javascript AFTER Angular Has Finished Loading All Views

后端 未结 6 1355
抹茶落季
抹茶落季 2020-12-24 12:10

I am building a web application using Angular, and I am trying to find a way to wait until all of the data-ng-include elements have been evaluated and the inclu

6条回答
  •  没有蜡笔的小新
    2020-12-24 12:49

    I think the appropiate answer is NO. You have to change the way you are looking at your app and Model and adapt it to the "angular way". Most likely there is a healthier way to achieve what you need. If you need to attach events to elements probably you may want to use a directive but of course I do not have enough information to judge at this stage what is best.

    angular.module along with directives is a good option to explore.

    Here is a plunker demo on how to use both with a JQUERY plug in:

    http://plnkr.co/edit/WGdNEM?p=preview

    Here is a an example with a directive on a separate file:

    http://plnkr.co/edit/YNBSWPLeWqsfGvOTwsMB?p=preview

提交回复
热议问题