Q. What does `ngOnDestroy()` lifecycle hook do?

  • (A) Cleans up before the component is removed
  • (B) Initializes the component
  • (C) Handles input changes
  • (D) Detects changes
πŸ’¬ Discuss
βœ… Correct Answer: (A) Cleans up before the component is removed
Explanation: `ngOnDestroy()` is used to perform cleanup like unsubscribing from observables.
Explanation by: Mr. Dubey
`ngOnDestroy()` is used to perform cleanup like unsubscribing from observables.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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