In an Angular application, how would you use the async pipe to ensure that a component automatically unsubscribes from an Observable when the component is destroyed?

  • Manually unsubscribe in the component
  • No need to unsubscribe with async pipe
  • Use *ngIf in the template
  • Use a try...catch block
When using the async pipe, you don't need to manually unsubscribe; it automatically handles it. There's no need to unsubscribe when using the async pipe.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *