Bird
0
0

Given this Angular component snippet, what will be the effect on performance?

medium📝 Predict Output Q4 of 15
Angular - Performance Optimization
Given this Angular component snippet, what will be the effect on performance? @Component({ selector: 'app-sample', changeDetection: ChangeDetectionStrategy.Default }) export class SampleComponent { data = [1, 2, 3]; }
AAngular checks for changes only when inputs change
BAngular runs change detection on every event
CAngular disables change detection
DAngular skips change detection entirely
Step-by-Step Solution
Solution:
  1. Step 1: Understand Default change detection behavior

    Default strategy runs change detection on every event, checking all bindings.
  2. Step 2: Compare with other strategies

    OnPush limits checks to input changes; Default does not.
  3. Final Answer:

    Angular runs change detection on every event -> Option B
  4. Quick Check:

    Default strategy = checks every event [OK]
Quick Trick: Default strategy triggers checks on all events [OK]
Common Mistakes:
  • Confusing Default with OnPush behavior
  • Thinking Default disables detection
  • Assuming detection skips without inputs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes