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就不用这句话了

  • 相关阅读:
    JavaScript 事件
    Docker 部署asp.netcore
    Docker 安装
    JavaScript 窗口操作
    JavaScript 定时器
    JavaScript Dom
    Javascript try catch es5标准模式
    JavaScript 数组去重
    JavaScript 返回具体类型方法
    mysql 触发器
  • 原文地址:https://www.cnblogs.com/cart55free99/p/4288318.html
Copyright © 2011-2022 走看看