Bird
0
0

Why does Angular's OnPush change detection strategy improve performance compared to Default?

hard📝 Conceptual Q10 of 15
Angular - Performance Optimization
Why does Angular's OnPush change detection strategy improve performance compared to Default?
AIt disables change detection completely
BIt runs change detection only when input references change
CIt runs change detection more frequently
DIt forces Angular to reload components on every event
Step-by-Step Solution
Solution:
  1. Step 1: Understand OnPush detection trigger

    OnPush triggers detection only when input object references change.
  2. Step 2: Compare with Default strategy

    Default runs detection on every event, causing more work.
  3. Final Answer:

    It runs change detection only when input references change -> Option B
  4. Quick Check:

    OnPush = detection on input reference change only [OK]
Quick Trick: OnPush triggers detection only on input reference changes [OK]
Common Mistakes:
  • Thinking OnPush disables detection
  • Believing OnPush runs detection more often
  • Assuming OnPush reloads components every event

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes