Q. What is the role of `ngOnDestroy` lifecycle hook?

  • (A) Initialize component
  • (B) Cleanup before component is destroyed
  • (C) Detect changes
  • (D) Load data
πŸ’¬ Discuss
βœ… Correct Answer: (B) Cleanup before component is destroyed
Explanation: `ngOnDestroy` is used to unsubscribe and cleanup resources.
Explanation by: Mr. Dubey
`ngOnDestroy` is used to unsubscribe and cleanup resources.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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