AngularJS Multiple ng-app within a page

后端 未结 13 2491
闹比i
闹比i 2020-11-22 01:48

I have just started learning Angular JS and created some basic samples however I am stuck with the following problem.

I have created 2 modules and 2 controllers.

13条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 02:28

    I have modified your jsfiddle, can make top most module as rootModule for rest of the modules. Below Modifications updated on your jsfiddle.

    1. Second Module can injected in RootModule.
    2. In Html second defined ng-app placed inside the Root ng-app.

    Updated JsFiddle: http://jsfiddle.net/ep2sQ/1011/

提交回复
热议问题