A

Admin • 833.24K Points
Coach

Q. How do you unsubscribe from an Observable in Angular?

  • (A) By calling unsubscribe() on the subscription
  • (B) By setting Observable to null
  • (C) Angular unsubscribes automatically for all Observables
  • (D) By using ngOnInit hook
  • Correct Answer - Option(A)
  • Views: 28
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin

To avoid memory leaks, unsubscribe manually or use AsyncPipe.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.