Bird
0
0

Why is the changeDetection property used in the @Component decorator?

hard📝 Conceptual Q10 of 15
Angular - Components
Why is the changeDetection property used in the @Component decorator?
ATo define the lifecycle hook for initialization
BTo specify the event that triggers component reload
CTo set the default CSS class for the component
DTo control how Angular checks for changes in the component
Step-by-Step Solution
Solution:
  1. Step 1: Understand changeDetection purpose

    The changeDetection property configures Angular's strategy for detecting changes in component data.
  2. Step 2: Differentiate from other properties

    It does not specify events, lifecycle hooks, or CSS classes.
  3. Final Answer:

    To control how Angular checks for changes in the component -> Option D
  4. Quick Check:

    changeDetection controls Angular's update checks [OK]
Quick Trick: changeDetection sets Angular's update strategy [OK]
Common Mistakes:
  • Confusing changeDetection with lifecycle hooks
  • Thinking it sets CSS or events

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes