Angular性能优化之脏检测
当我们在使用 Angular 框架搭建项目时,随着组件越来越多,页面也来越复杂,性能会越来越低,主要表现在 CPU 使用率 很高。所以我们要对项目做一定的优化。
Angular脏检查(Change Detection)机制
Angular 的脏检测主要是指 zone.js,这是一个开源的第三方库,github地址。
关于 zone.js 的定义,官方解释为:
A Zone is an execution context that persists across async tasks, and allows the creator of the zone to observe and control execution of the code within the zone.
简单来说&