Bird
0
0

Which lifecycle hook is called once after Angular first displays the data-bound properties of a component?

easy📝 Conceptual Q2 of 15
Angular - Lifecycle Hooks
Which lifecycle hook is called once after Angular first displays the data-bound properties of a component?
AngDoCheck
BngOnDestroy
CngAfterViewInit
DngOnInit
Step-by-Step Solution
Solution:
  1. Step 1: Identify lifecycle hook timing

    ngOnInit runs once after Angular sets input properties and displays data-bound properties.
  2. Step 2: Match hook to description

    ngOnDestroy runs on destruction, ngAfterViewInit after view init, ngDoCheck on every change detection; only ngOnInit fits.
  3. Final Answer:

    ngOnInit -> Option D
  4. Quick Check:

    First display hook = ngOnInit [OK]
Quick Trick: ngOnInit runs once after inputs are set [OK]
Common Mistakes:
  • Confusing ngOnInit with ngAfterViewInit
  • Thinking ngOnDestroy runs on initialization

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes