async pipe (Angular)
Unwraps a value from an asynchronous primitive.
Last updated
Was this helpful?
Unwraps a value from an asynchronous primitive.
Last updated
Was this helpful?
The pipe subscribes to an Observable
or Promise
and returns the latest value it has emitted. When a new value is emitted, the pipe marks the component to be checked for changes. When the component gets destroyed, the pipe unsubscribes automatically to avoid potential memory leaks.
We can use Observables without using the subscribe method in our logic by following the next snippets:
We will use the async pipe in our HTML code. Unwraps a value from an asynchronous primitive.