0Pricing
Angular Academy · Lesson

The async Pipe

Subscribe in templates without manual cleanup.

What the async pipe does

The async pipe subscribes to an Observable (or Promise) in the template, renders the latest emitted value, and automatically unsubscribes when the component is destroyed.

Basic usage

Bind an observable directly in the template and pipe it through async.

@Component({
  template: '<p>{{ message$ | async }}</p>'
})
export class HelloComponent {
  message$ = of('Hello from RxJS');
}

All lessons in this course

  1. Observables and Subscriptions
  2. Subjects and BehaviorSubject
  3. Unsubscribing and Memory Leaks
  4. The async Pipe
← Back to Angular Academy