How to register two modules to ng-app?

前端 未结 1 1996
灰色年华
灰色年华 2021-02-01 08:05

In my application I have two modules, which are used for routing. Here is the code of it

//Module1:

 angular.module(\'phonecat\', []).
         


        
1条回答
  •  故里飘歌
    2021-02-01 08:23

    You can create a top level module that will have your two modules as injected dependencies:

    var app = angular.module('app', ['phonecat', 'computer']);
    

    and then in your html use:ng-app="app"

    0 讨论(0)
提交回复
热议问题