A

Admin • 832.27K Points
Coach

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

  • (A) ngOnDestroy
  • (B) ngAfterViewInit
  • (C) ngOnInit
  • (D) ngDoCheck
  • Correct Answer - Option(A)
  • Views: 14
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin

Use `ngOnDestroy` to clean up subscriptions and other resources before the component is destroyed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.