[AngularJS] New in Angular 1.3 - Performance Boost with debugInfoEnabled
Angular in with New 1.3 angularjs Boost performance
2023-09-14 08:59:21 时间
By default, Angular provides a lot of debug information on the DOM that's only necessary for tools like Protractor and Batarang. Angular 1.3 allows you to turn off the debug information to give your app a simple performance boost.
See: https://docs.angularjs.org/api/ng/provider/$compileProvider
More: https://docs.angularjs.org/guide/production#disabling-debug-data
<!DOCTYPE html> <html ng-app="app"> <head> <title></title> <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"> <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.3/angular.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.11/angular-ui-router.js"></script> <script src="app.js"></script> </head> <body> <script type="text/ng-template" id="templates/home.html"> <note message="Hello"></note> </script> <ui-view></ui-view> </body> </html>
angular.module("app", ["ui.router"]) .config(function config($stateProvider, $compileProvider) { $stateProvider.state("home", { url: "", templateUrl: "templates/home.html" }) $compileProvider.debugInfoEnabled(false); }) .directive("note", function note() { return { template: "<div>{{ note.message }} {{ note.person }}</div>", controller: "NoteController as note", bindToController: true, scope: { message: "@" } } }) .controller("NoteController", function NoteController() { var note = this; note.person = "John"; })
Without debug info:
If you want open the debug info again:
in console:
angular.reloadWithDebugInfo();
相关文章
- Angular tsconfig.json 文件里的 paths 用途
- Angular和Vue.js 深度对比
- SAP 电商云 Spartacus UI Angular UI 和 Accelerator JSP UI 的混合使用
- 如何在Angular项目中使用MQTT
- 关于 Angular 应用的入口
- Angular SSR 和 PWA 结合起来使用的一些现象观察
- 【Angular教程】-内容投影u002F@ContentChildu002F@ViewChild
- 关于 Angular 应用对浏览器 Back 按钮支持问题的讨论
- 关于 Angular 开发时对主流浏览器支持的话题
- 运算MySQL无法使用IN操作(mysql不能用in)
- 搜索MySQL中IN搜索的应用(mysql包含in)
- 利用Oracle中IN函数进行数据查询(oracle带in函数)
- MySQL使用IN查询时数量超限问题的解决方法(mysql中in超过数量)
- MySQL中IN查询的使用及效率优化(mysql中in的0)
- MySQL中如何使用IN操作符(mysql中in怎么写)
- 以Oracle IN查询精准定位你要的信息(oracle使用in查询)
- Oracle中列转IN更快更智能的架构方案(oracle中列转列in)
- Oracle数据库中的IN关键字深度剖析(oracle中in的详解)
- 使用Oracle中的IN条件实现复杂查询(oracle中in条件)
- 利用Oracle中的If In语句减少数据处理时间(oracle中if in)
- angular.foreach循环方法使用指南
- angular中使用路由和$location切换视图