Angular · Middle · Question 3 of 75
When do you need ChangeDetectorRef.markForCheck()?
- ✓Correct answer: In an OnPush component when state changes outside Angular's knowledge, e.g. a manual
subscribethat sets a plain field - 2After every assignment in every component
- 3To force a full page reload
Explanation
markForCheck marks the component and its ancestors so they are checked in the next run. The async pipe and signals do this automatically, which is why they are preferred over manual subscriptions.