AngularJS--Bootstrap (starter)

Source: Internet
Author: User

Bootstrap (Initialize)

This chapter describes the angular initialization process and how to manually initialize the angular when necessary.

    1. Angular <script> Tags
    2. Don't say anything, let's start with an example. This example shows how angular recommends inheriting angular and automatically initializing angular.
<!DOCTYPE HTML><HTMLXmlns:ng= "http://angularjs.org"Ng-app>  <Body>    ...    <Scriptsrc= "Angular.js">  </body></html>

1. We should place the script tag at the bottom of the page. This can improve the load time of your application. You can get the latest version from http://code.angularjs.org.

2. Ng-app indicates the root of your angular application. If you want your entire page to be a angular application, you can put it on the

3. If you choose to compare the old instruction syntax, for example: In order to be compatible with IE's lower version, you use the namespace in the HTML tag (this is a historical reason, we do not recommend that you use the namespace).

Automatic initialization

If the Angular.js script is referenced and document.readystate is the "complete" state, then Angularjs is automatically initialized in the Domcontentloaded event. At this point, angular will first look for the Ng-app directive as the root of your application. If angular discovers the Ng-app directive, it will:

1. Load the module associated with this instruction.

AngularJS--Bootstrap (starter)

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.