search

Home  >  Q&A  >  body text

angular.js - Can you tell whether the angularjs module is started?

The module I use to start Angular in my application is asynchronous, so multiple files need to determine whether the module has been started. If it is not started, start it. If it is started, use it directly.
I would like to ask if AngularJS provides a detection mechanism

怪我咯怪我咯2794 days ago554

reply all(3)I'll reply

  • 迷茫

    迷茫2017-05-15 17:07:23

    The question I asked makes no sense

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-15 17:07:23

    angular.module('xxx',[]).run(function(){
        console.log('初始化完毕');
    });

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-15 17:07:23

    This can be found in the source code

    if(!window.angular.bootstrap){
        angular.bootstrap(app, ['MyModule']);
    }

    reply
    0
  • Cancelreply