如何将$ compileProvider.debugInfoEnabled设置为false可以改善anglejs中的性能1.3? [英] How $compileProvider.debugInfoEnabled set to false improve performance in angularjs 1.3?

查看:283
本文介绍了如何将$ compileProvider.debugInfoEnabled设置为false可以改善anglejs中的性能1.3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从角度网站上阅读有关 debugInfoEnabled 的文档。
仍然不清楚概念,如何 $ compileProvider.debugInfoEnabled(false)内角配置可以通过删除元素级别类(角度)来提高应用程序的性能-directives)绑定,例如 ng-scope ng-isolated-scope


有没有人知道,在$ code> $ compileProvider 中将debugInfoEnabled设置为false可以提升性能?
任何人都可以帮助我清除角度上的角度 $ compileProvider.debugInfoEnabled 功能的概念?



任何帮助将会感谢,提前感谢:)

解决方案

您的DOM元素是指令(指令可以是元素,属性,类或注释)。



当角度编译DOM并命中一个指令时,它将通过该指令逻辑来改变,操纵,更新或做任何任务,这是指令是要求有角度的。



例如,它将采取你的ng-repeat指令和构建相应地删除多个DOM元素。



通过删除这些指令(类似于ng-scope& ng-isolation-scope),角度将不会停止在这些位置并执行逻辑。因此,实现了性能提升。


I read the the documentation from angular website about debugInfoEnabled. Still doesn't clear with concept, how $compileProvider.debugInfoEnabled(false) inside angular config can improve the performance of application by removing the element level class (angular-directives) binding such as ng-scope and ng-isolated-scope.

Does anyone know, how performance boost can happen by setting up debugInfoEnabled to false in $compileProvider? Can anyone help me to clear out my concept about angular $compileProvider.debugInfoEnabled feature of angular 1.3?

Any Help would appreciated, Thanks in advance:)

解决方案

These classes that are added to your DOM elements are directives (directive can be elements, attributes, classes, or comments).

When angular is compiling the DOM and hits a directive it then runs through that directives logic to change, manipulate, update, or do whatever task it is that the directive is asking angular to do.

For example it will take your ng-repeat directives and build out multiple DOM elements accordingly.

By removing these directives (classes like ng-scope & ng-isolated-scope) angular will not stop at these locations and execute logic. Because of this the performance increase is achieved.

这篇关于如何将$ compileProvider.debugInfoEnabled设置为false可以改善anglejs中的性能1.3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆