R

Ram Sharma • 3.40K Points
Extraordinary

Q. What does the Angular `ngOnDestroy` hook do?

  • (A) Initializes component
  • (B) Cleans up before component is destroyed
  • (C) Detects changes
  • (D) Runs after every DOM update
  • Correct Answer - Option(B)
  • Views: 4
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Ram Sharma
ngOnDestroy is used to perform cleanup logic like unsubscribing from observables.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.