How many ng-App attributes can be declared in in Angular JS? and under what circumstances?
Run Code Online (Sandbox Code Playgroud)
据我所知,ng-app用于Angular JS应用程序的自动引导程序.
mus*_*.0x 11
http://docs.angularjs.org/api/ng.directive:ngApp
每个HTML文档只能自动引导一个AngularJS应用程序.在文档中找到的第一个ngApp将用于定义作为应用程序自动引导的根元素.要在HTML文档中运行多个应用程序,必须使用angular.bootstrap手动引导它们.AngularJS应用程序不能互相嵌套.
TL; DR:你可以拥有多个,但只有第一个会被引导.
这个问题类似于:
| 归档时间: |
|
| 查看次数: |
6737 次 |
| 最近记录: |