ChangeDetectionStrategy.OnPush. What triggers this component to check for updates and re-render?OnPush tells Angular to check the component only when its inputs change or when an event inside it happens. This improves performance by skipping unnecessary checks.
ChangeDetectionStrategy.OnPush in Angular components?OnPush reduces how often Angular checks the component by only running change detection when inputs change or events happen, which helps performance.
OnPush checks for changes by comparing input references. If the object reference does not change, Angular assumes no update is needed, even if properties inside the object changed.
OnPush detects changes by checking if the input reference changes. Mutating properties without changing the reference will not trigger updates.
ChangeDetectionStrategy.OnPush in an Angular component?The correct property name is changeDetection and the value must be ChangeDetectionStrategy.OnPush (an enum), not a string or undefined identifier.