What you will learn
Understand how Angular schedules focused view updates without Zone.js.
- Angular 22 applications are zoneless by default. Angular schedules rendering from signals, template listeners, AsyncPipe, input changes, and explicit change-detection notifications.
- Signals make dependencies visible: a template that reads count() is refreshed when count changes. computed() derives cached state without manually coordinating subscriptions.
- Code that changes plain fields from an external callback must notify Angular. Prefer signals, an observable consumed with AsyncPipe, or ChangeDetectorRef.markForCheck().
- Use afterNextRender for browser work that must run after Angular commits the next render. Avoid changing state in a loop just to force a refresh.
How it works
1Event changes signal
2Angular records notification
3Affected view renders
4Browser displays state
Expected result
The clock refreshes each second because updating the signal schedules the component view update.
Common mistakes
Do not add Zone.js to hide unclear state ownership. Do not mutate an object inside a signal without calling set or update. Always clean up long-lived browser callbacks.
