在angularJS嵌套应用程序内部控制 [英] Nested App inside controller in angularJS
问题描述
我怎样才能实现这一结构AnglularJS?
how can I achieve that structure in AnglularJS ?
<body ng-app="mainBodyAppWrapper">
<div ng-controller = "mainBodyController">
<div ng-app="myApp">
<div ng-controller="controller3">
First Name : <input ng-model="myApp_fName3" type="text"/>
Last Name : <input ng-model="myApp_lName3" type="text"/>
Hello {{myApp_fName3}} {{myApp_lName3}} !!!
</div>
<hr/>
</div>
</div>
</body>
在这种情况下,我有一个错误的https://docs.angularjs.org/error/ng/areq?p0=controller3&p1=not%20a%20function,%20got%20undefined
in that case I have an error https://docs.angularjs.org/error/ng/areq?p0=controller3&p1=not%20a%20function,%20got%20undefined
任何一个知道那种错误的解决方案?请帮我出
Any one know about that kind of error solution? Please help me out
推荐答案
您不能在一个页面中使用多个NG-应用程序。如果你真的需要使用多个模块,考虑的Bootstrap第二个模块。欲了解更多信息,请阅读<一href=\"http://stackoverflow.com/questions/12860595/how-to-define-two-angular-apps-modules-in-one-page\">How定义两个角的应用程序/在一个页面模块
You cannot use multiple ng-app in a page. If you really need to use multiple modules, consider bootstraping the second module. For more info, read How to define two angular apps / modules in one page
这篇关于在angularJS嵌套应用程序内部控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!