Change Detection Deep Dive
Introduction
Section titled “Introduction”Angular’s change detection determines when to update the DOM. It’s triggered by Zone.js patching browser async APIs.
How It Works
Section titled “How It Works”- User clicks button → Zone.js intercepts
- Microtask queue empties → onMicrotaskEmpty fires
- ApplicationRef.tick() runs change detection
- Angular walks component tree, checks bindings
- Updates DOM where values changed
Zone.js Alternative (Angular 18+)
Section titled “Zone.js Alternative (Angular 18+)”Signals enable zone-less change detection for finer-grained updates.”