Multiple Module in Angularjs

后端 未结 5 1295
-上瘾入骨i
-上瘾入骨i 2020-12-02 20:26

Is it possible to create multiple module in an Angular Script? I went through the documentation and learned that it is some kind of main method concept.

I need examp

5条回答
  •  孤城傲影
    2020-12-02 20:36

    I think that he has confused module with ngApp, in that there is only one application (ng-app) on a page and that the app's view (ngView or ) can only exist once as well. But as stated in previous answers you can create as many modules as you like and inject them as dependencies into your "main" application module. I usually do this to separate my directives, filters, controllers and such in their own modules.

    Edit:

    ngApp - http://code.angularjs.org/1.1.5/docs/api/ng.directive:ngApp

提交回复
热议问题