NGXF
  • 🚀Introduction
  • Get Started
    • Why
    • Installation
  • Concepts
    • Introduction
  • Features
    • Activated Route
    • Call
    • Init
    • Lazy
    • Keep Alive
    • Timeout
    • Track By Key
    • Repeat
    • Virtual Scroll
  • Server Interaction
    • Async
    • Cookies
    • Http
    • Socket.IO
  • Hooks
    • State Hook
    • Effect Hook
    • Reducer Hook
  • Recompose
    • Compose
  • API
    • NgxfModule
    • HttpDirective
    • RouteDirective
    • InitDirective
    • ComposeDirective
    • ReturnDirective
    • TimeoutDirective
    • CookiesDirective
    • AsyncDirective
    • LazyDirective
    • CallPipe
  • Recipes
    • Caching
    • Style Guide
  • Community
    • FAQ
    • Contributing
Powered by GitBook
On this page
  • Async as Structural Directive
  • Async as Binding Directive
  1. Server Interaction

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>

PreviousVirtual ScrollNextCookies

Last updated 6 years ago