Translation: HTTPS://DOCS.ANGULARJS.ORG/API/NG/DIRECTIVE/NGAPP
Use this command to automatically boot a ANGULARJS application. The ngapp directive specifies which element in HTML is the execution root of the angularjs, or scope. The typical usage is to put this attribute on the <body> or
An HTML document has only one ngapp instruction that is automatically booted. Generally the first Ngapp is defined as the default automatic boot instruction. If you want to run multiple ANGULARJS programs in an HTML document, you need to manually set up the boot in angular.bootstrap . ANGULARJS applications cannot be nested with each other.
You can specify a AngularJS module as the root module for your application. When the program is started, the module will be loaded onto the $injector, and the module dependent modules will be loaded and initialized. For more details please refer to angular.module .
in the following example, if Ngapp directives are not placed on the parent container, the internal instructions are not compiled and AppController are not instantiated. {{a+b}} will not be processed to 3 .
Ngapp is the easiest and most common way to boot a program.
Instruction Information
The priority of this command is 0.
Use
< any Ng-app ="" [ng-strict-di= ""]>... </ any >
Parameters
| parameters |
type |
description |
| ngapp |
Angular. Module |
an optional program module name that loads the module if it exists |
| ngstrict |
boolean |
if this genus Sex appears on the document label, and injection is created as a "Strict-di" mode. This means that if the program does not use the detailed program annotations it will fail to invoke, as described in the Dependency Injection guide, useful debugging information will help track these bugs. |