Run Javascript AFTER Angular Has Finished Loading All Views

后端 未结 6 1346
抹茶落季
抹茶落季 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:32

    on content loaded:

    $rootScope.$on('$includeContentLoaded', function() {
        //do your will
    });
    

    on content requested:

    $rootScope.$on('$includeContentRequested', function() {
        //...
    });
    

提交回复
热议问题