Compose

Provides template composition in templates.

Create Enhancer with Rename Prop

An example in COMPONENT.template.html.

<ng-container *compose="let enhancer of [rename]">
  <div *ngTemplateOutlet="enhancer(greet) context { text: 'Hello, World!' }"></div>
</ng-container>

<ng-template #rename>
  <ng-container *renameProp="'text' to 'name'"></ng-container>
</ng-template>

<ng-template #greet let-name="name">{{ name }}</ng-template>

<!-- Will show `Hello World!` -->

Last updated