Skip to main content

What is Change Detection in Angular and how does it work?

Junior Angular
Quick Answer Change Detection (CD) checks if component model has changed and updates the DOM. Zone.js detects async operations and triggers CD. Angular traverses the component tree top-down checking each component. Default strategy: check all components on every CD cycle. OnPush: check only when inputs change or local event fires. Use OnPush for performance optimization in large component trees.

Answer

Change detection updates the UI when data changes. Angular checks component trees after async events using Zone.js.

Two strategies exist: Default (checks all components) and OnPush (checks only when needed).

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