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>
Last updated