A

Admin • 828.70K Points
Coach

Q. Which lifecycle hook is used to clean up subscriptions and detach event handlers before a component is destroyed?

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

Explanation by: Admin
ngOnDestroy is called just before the component is destroyed to perform cleanup.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.