Q. What does `ngOnInit` lifecycle hook do?

  • (A) Initializes the component after Angular sets the data-bound properties
  • (B) Destroys the component
  • (C) Creates the component
  • (D) Validates the form
πŸ’¬ Discuss
βœ… Correct Answer: (A) Initializes the component after Angular sets the data-bound properties
Explanation: `ngOnInit` is called once, after the first `ngOnChanges`, and is used to initialize the component.
Explanation by: Mr. Dubey
`ngOnInit` is called once, after the first `ngOnChanges`, and is used to initialize the component.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
87
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
96%
Success Rate