NGAPP directive, which is the Ng-app attribute

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.