Bird
0
0

Why might OnPush change detection cause a component to not update even though data changed internally?

hard🧠 Conceptual Q10 of 15
Angular - Change Detection
Why might OnPush change detection cause a component to not update even though data changed internally?
ABecause OnPush disables all change detection for performance.
BBecause Angular requires manual calls to detectChanges() always with OnPush.
CBecause OnPush only checks for input reference changes or events inside the component.
DBecause OnPush only works with primitive input types.
Step-by-Step Solution
Solution:
  1. Step 1: Understand OnPush detection triggers

    OnPush runs detection only on input reference changes or internal events.
  2. Step 2: Explain internal data change effect

    Internal changes without input reference change or event do not trigger detection automatically.
  3. Final Answer:

    Because OnPush only checks for input reference changes or events inside the component. -> Option C
  4. Quick Check:

    OnPush updates only on input ref or events [OK]
Quick Trick: OnPush ignores internal changes without input ref change [OK]
Common Mistakes:
MISTAKES
  • Thinking OnPush disables detection
  • Believing manual detectChanges() always needed
  • Assuming OnPush only works with primitives

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes