Q. Which lifecycle hook is called before a component is destroyed?

  • (A) ngOnDestroy
  • (B) ngAfterViewInit
  • (C) ngOnInit
  • (D) ngDoCheck
πŸ’¬ Discuss
βœ… Correct Answer: (A) ngOnDestroy
Explanation: Use `ngOnDestroy` to clean up subscriptions and other resources before the component is destroyed.
Explanation by: Mr. Dubey
Use `ngOnDestroy` to clean up subscriptions and other resources before the component is destroyed.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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