When an Observable is no longer needed, it should be ________ to prevent memory leaks.

  • Composed
  • Pipelined
  • Subscribed
  • Unsubscribed
To prevent memory leaks in Angular applications when an Observable is no longer needed, it should be unsubscribed. Failing to unsubscribe from Observables can lead to resource leaks, as they may continue to emit values and hold references to objects even after the component or service that used them is destroyed. Properly unsubscribing from Observables ensures that they are cleaned up and do not cause memory issues.
Add your answer
Loading...

Leave a comment

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