Skip to main content

What triggers Change Detection in Angular, and why is understanding this important?

Junior Angular
Quick Answer Change Detection triggers: any browser event (click, keyup), XHR response, timer (setTimeout, setInterval), Promise resolution. Zone.js patches all these to notify Angular. Avoid triggering CD unnecessarily: run non-UI work outside Angular zone (NgZone.runOutsideAngular), use OnPush strategy, use pure pipes, debounce frequent events. Understanding triggers is key to performance optimization.

Answer

Angular change detection is triggered by async events handled by Zone.js, such as timers, promises, user events, and HTTP calls.

Understanding these triggers helps avoid unnecessary re-renders, optimize performance, and decide when to use OnPush strategy.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice