A

Admin • 833K Points
Coach

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
  • Correct Answer - Option(A)
  • Views: 16
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin

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

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.