引导方法和运行方法之间的角度有什么区别
what's the difference in angular between bootstrap method and run method?
我目前正在使用 bootstrap
angular 以这种方式运行我的应用程序:
ng.bootstrap(document, ['main']);
Angular 文档指出
Run blocks are the closest thing in Angular to the main method.
A run block is the code which needs to run to kickstart the application.
那么它们之间有什么区别呢?
run
方法只是添加创建注入器并初始化模块后需要调用的函数。这些函数通常包含初始化模块的方法。然而,bootstrap
方法告诉angular
创建注入器并开始执行使用 config
和run
方法添加的功能。所以执行顺序大致是这样的:
1. Create injector
2. Execute functions added with config() method for each module
3. Execute functions added with run() method for each module
4. Start compilation phase
5. Start linking phase
相关文章:
- 打破承诺链的好方法是什么
- 在JavaScript中拆分日期字符串的更好方法是什么
- 将jQuery.ech()方法转换为本地JavaScript抽象的最佳方法是什么
- 处理浮点错误的最佳方法是什么
- 基于窗口宽度jquery的函数的替代方法是什么
- 实现比较方法的最佳实践是什么;s的比较类型是在运行时选择的
- 什么'这是从第三个函数上的async 1st函数获得结果的更好方法
- knex:根据结果创建数组的合适方法是什么
- 以编程方式填充组合框道场 (1.8) 的最佳方法是什么?
- node.js是否具有'match()'方法如果是,语法是什么
- 使用Modernizr检测移动设备最可靠的方法是什么
- 确定var是否是javascript中的elementFinder对象的方法是什么
- 用javascript修复这个JSON对象字符串最干净的方法是什么
- 让会话值可用于JavaScript的好方法是什么
- 从AngularJs获取谷歌地图对象的正确方法是什么
- 有没有什么方法可以停止Jquery中的animate(也可以停止完整的回调函数)
- 使用ReactJS和Flux架构从服务器获取数据的正确方法是什么
- 什么是“;右“;使用addClass/delay/removeClass的方法
- 函数调用方法有什么用
- 列出没有 mysql 的元素的最佳方法是什么