> For the complete documentation index, see [llms.txt](https://ngxf.gitbook.io/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ngxf.gitbook.io/platform/server-interaction/async.md).

# Async

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

## Async as Structural Directive

An example in `COMPONENT.template.html`.

```markup
<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`.

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