-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Closed
Labels
Milestone
Description
Is this a bug report or a feature request?
- Bug Report
- Feature Request
Please provide the steps to reproduce the issue [Bug Report only]
Suppose I have this demo code :
this.zone.runOutsideAngular(() => {
document.getElementsByTagName('button')[0].addEventListener('click', () => {
this.zone.run(() => this.name += ' test');
});
});
The devTools will report that the change detection source is HTMLButtonElement.addEventListener:click
or
this.zone.runOutsideAngular(() => {
window.setTimeout(() => {
this.zone.run(() => this.name += ' test');
}, 3000);
})
Here the devTools report setTimeout
as the source.
I find this a bit misleading since addEventListener
/setTimeout
are called outside the angular zone and it's the zone.run
that is responsible for calling the change detection.
This thing happens with
WDYT ?