Q. Which hook is used for cleanup logic before a component is destroyed?

  • (A) ngOnDestroy
  • (B) ngOnChanges
  • (C) ngAfterViewInit
  • (D) ngOnInit
πŸ’¬ Discuss
βœ… Correct Answer: (A) ngOnDestroy
Explanation: `ngOnDestroy` is called just before Angular destroys the component.
Explanation by: Mr. Dubey
`ngOnDestroy` is called just before Angular destroys the component.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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