0
What happens if you set ChangeDetectionStrategy.OnPush but keep mutating objects in place?
subina kallyani
medium
0completed
329
Answer
Angular with OnPush only checks components when:
- An
@Input()reference changes - An event inside the component fires
markForCheck()is called manually
If you mutate an object (like user.name = 'New') without creating a new reference, Angular will not detect the change, and the view won’t update.
Click to Reveal Answer
Tap anywhere to see the solution
Revealed
Comments0