1.0.1 • Published 2 years ago
@awesome-ng/let v1.0.1
@awesome-ng/let
Simple angular structural directive for declaring and sharing data as local variable in template.
StackBlitz demo
Installation:
Install with npm:
npm i @awesome-ng/let --save-dev
Setup:
Import AngLetModule
into a module where you want to use *angLet
directive:
import { AngLetModule } from '@awesome-ng/let';
@NgModule({
imports: [AngLetModule],
})
Use *angLet
directive in your template:
<ng-template *angLet="observable$ | async as value"> <!-- single subscription -->
<h1>{{ value }}</h1>
<h2>{{ value }}</h2>
...
</ng-template>