Junior From PDF Angular Angular

What is the difference between default and onPush change detection strategies in Angular?

Change

Detection

Strategy

Description When to Use

Default Angular checks every

component in the component

tree every cycle

Simple apps or components with

frequent changes

OnPush Angular checks component only

if input references change or

events

Optimizes performance, suitable

for immutable data & smart

components

How to set OnPush:

@Component({

selector: 'app-example',

changeDetection: ChangeDetectionStrategy.OnPush,

template: `...`

})

export class ExampleComponent {}

Key Difference:

  • Default: Runs change detection every time.
  • OnPush: Runs only when inputs change by reference or manual trigger.

More from Angular Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details