Angular-bootstrap and Compiler

Source: Internet
Author: User
Tags manual xmlns

The angular JS framework is briefly described in the previous section, where the angular bootstrap (bootstrap) and compiler (compilation) mechanisms will continue.

One: Initialization of Bootstrap:angular

The initial automation recommended by 1:angular is as follows:

<!doctype html>   

Use Ngapp to mark the root node of the application that you need to automatically boot, typically HTML tag. The domcontentloaded event triggers the angular to automatically look for Ngapp as the root node of the application and, if found, does the following:

Load module (module) related directive (instruction).

Create an application injector (angular injection mechanism).

Compiles the instructions that handle Ng-app as the root node. This allows you to customize the Select Dom node as the application root node.

&lt;! DOCTYPE html>   
       

2: Manual initialization:

If you want to have more control over the initialization, you can initialize the automatic initialization instead of the angular by using a custom manual boot method. For example, you need to do something before angular the template, such as changing some of the template's content. The manual boot method will be as follows:

<!doctype html>   
       

After all the code on the page has finished loading, locate the HTML template root node (typically the document element).

Call Api/angular.bootstrap (Angular.bootstrap (element[, modules)) to compile the template so that it can be executed.

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.