πŸ“Š Angular
Q. What is the role of `ngOnDestroy()` lifecycle hook?
  • (A) To clean up just before Angular destroys the component
  • (B) To create the component
  • (C) To validate forms
  • (D) To load services
πŸ’¬ Discuss
βœ… Correct Answer: (A) To clean up just before Angular destroys the component

Explanation: `ngOnDestroy` is used for cleanup logic like unsubscribing observables.

Explanation by: Mr. Dubey
`ngOnDestroy` is used for cleanup logic like unsubscribing observables.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
42
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
94%
Success Rate