Angular · Senior · Question 1 of 75
How does Zone.js let Angular know when to run change detection?
- ✓Correct answer: It patches async browser APIs (events, timers, promises, XHR) and notifies Angular when a task finishes, which triggers
ApplicationRef.tick() - 2It compares the DOM with a virtual DOM every 16 ms
- 3Angular polls every component field for changes
Explanation
Zone.js doesn't know *what* changed, only that some async work completed, so Angular checks the tree from the root (skipping OnPush subtrees that are not dirty). That is simple but can cause many unnecessary checks.