zoukankan      html  css  js  c++  java
  • AngularJS bootStraping

    看这个

    http://www.dotnet-tricks.com/Tutorial/angularjs/5aWL261214-Understanding-AngularJS-Bootstrap-Process.html

    其中提到

    Angular initializes automatically upon DOMContentLoaded event or when the angular.js script is downloaded to the browser and the document.readyState is set to complete.

    什么是bootstrapping呢?

    1. Load the module associated with the directive.

    2. Create the application injector.

    3. Compile the DOM starting from the ng-app root element.

    This process is called auto-bootstrapping.

    angular.bootstrap(document, ['myApp']);

    这其实这就是给某一个元素设置了  ng-app="myApp" 这个属性

    以往看到的例子都是 <body ng-app="myApp">  这里是给document设置了 ng-app  

    document是一个比<html> 还要高一个层级的

    所以如果页面中已设置了ng-app就不用这句话了

  • 相关阅读:
    html 一号店静态页面
    多线程
    TCP通信
    MySQL连接查询
    Mysql数据库 DDL 数据定义语言
    MySQL数据库 DML 数据操作语言
    java字符流
    java File类
    java变量
    JDK、JRE、JVM的关系
  • 原文地址:https://www.cnblogs.com/cart55free99/p/4288318.html
Copyright © 2011-2022 走看看