Async

The async directive is used instead of subscribe and unsubscribe in the component.

Async as Structural Directive

An example in COMPONENT.template.html.

<ng-container *async="
  let data from source;
           next onNext;
          error onError;
       complete onComplete
">{{ data }}</ng-container>

Async as Binding Directive

An example in COMPONENT.template.html.

<ng-template
  let-data
  [async]="async"
  (next)="next($event)"
  (error)="error($event)"
  (complete)="complete($event)"
>{{ data }}</ng-template>

Last updated