'Is there any way to find out what is triggering change detection in Angular 2?
I recently released a new component and it seems to be triggering change detection multiple times a second:
// some debugging code
ngDoCheck() {
console.log('DO_CHECK', new Date().toLocaleTimeString());
}
Results:
I've yet to figure out what is triggering this.
Am I reading this output correctly? Change detection is being triggered multiple times a second?
Is there any good method for figuring out what is triggering change detection in an Angular 2 application?
Solution 1:[1]
The Angular DevTools for Chrome provide a profiler that will list all change detection events and will show the source for each event.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | slim |