We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
说到 AngularJS 的性能优化,一个很重要的点就是从 数据的脏检查 开始:
做一个试验,看看什么情况下,变量会被加入到 $$watchers 中
http://plnkr.co/edit/hDHmkdNjQQkdwscjouzE?p=preview
再看看什么情况会触发脏检查
$watch(watchExpression, listener, [objectEquality])
参考资料: https://docs.google.com/presentation/d/15XgHRI8Ng2MXKZqglzP3PugWFZmIDKOnlAXDGZW2Djg/edit#slide=id.g2a0ec7d53_00 https://www.ng-book.com/p/The-Digest-Loop-and-apply/
The text was updated successfully, but these errors were encountered:
No branches or pull requests
AngularJS 性能优化
说到 AngularJS 的性能优化,一个很重要的点就是从 数据的脏检查 开始:
理解脏检查机制 参考 #27
做一个试验,看看什么情况下,变量会被加入到 $$watchers 中
http://plnkr.co/edit/hDHmkdNjQQkdwscjouzE?p=preview
再看看什么情况会触发脏检查
减少 $watch list 数量,有以下处理手段:
降低 $watch list 中表达式的复杂度
$watch(watchExpression, listener, [objectEquality])
不要使用第三个参数减少触发 $digest loop
缩小 $digest 的影响范围
其他方面:
参考资料:
https://docs.google.com/presentation/d/15XgHRI8Ng2MXKZqglzP3PugWFZmIDKOnlAXDGZW2Djg/edit#slide=id.g2a0ec7d53_00
https://www.ng-book.com/p/The-Digest-Loop-and-apply/
The text was updated successfully, but these errors were encountered: