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
  • Create Variable
  • Create Async Variable
  • Create Nested Variable
  1. Features

Init

Provides to create any variables in templates.

Create Variable

An example in COMPONENT.template.html.

<ng-container *init="'LOL' as myVar">
    {{ myVar }}
</ng-container>

Create Async Variable

An example in COMPONENT.template.html.

<ng-container *init="source | async as myVar">
    {{ myVar }}
</ng-container>

Create Nested Variable

An example in COMPONENT.template.html.

<ng-container *init="{
  lol: 'Lol',
  foo: source | async,
  bar: source | async
} as myVar">
  lol: {{ myVar.lol }}
  foo: {{ myVar.foo }}
  bar: {{ myVar.bar }}
</ng-container>
PreviousCallNextLazy

Last updated 6 years ago