How to Lazy load non-angular JavaScript files using AngularJS?

后端 未结 3 1067
深忆病人
深忆病人 2020-12-15 21:43

Is it possible to load plain old JS or AMD modules from an Angular Controller? I have previously used RequireJS for this.

I have used AngularJS and RequireJS on a fa

3条回答
  •  一生所求
    2020-12-15 21:55

    Angular's module system is not like RequireJS. Angular only concerns itself with module definition and composition but not with module loading.

    That means angular will not issue an HTTP request for loading any javascript, you are responsible for loading that yourself, by using

提交回复
热议问题