Skip to content

OnPush Change Detection

OnPush reduces the number of change detection cycles by only checking components when specific conditions are met.

  1. @Input reference changes
  2. Event originates inside component
  3. async pipe emits new value
  4. markForCheck() called manually
@Component({
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ProductCardComponent {
@Input() product: Product;
}

OnPush is the standard strategy for production Angular apps.”