1<!-- Alternative syntax -->
2<ng-container
3 *ngTemplateOutlet="optionTemplate; context:{ $implicit: option, idx: i }"
4></ng-container>
5><Copy
1<!-- Define our template -->
2<ng-template #myTemplate> World! </ng-template>
3
4Hello
5<!-- Render the template in this outlet -->
6<ng-container [ngTemplateOutlet]="myTemplate"></ng-container>
7<>Copy
1<ng-template #optionTemplate let-option let-position="idx">
2 {{ position }} : {{option}}
3</ng-template>
4
5<!-- client-one.component.html --><>Copy
1<li *ngFor="let item of items; index as i">
2 <!-- Setting the option as the $implicit property of our context along with the row index -->
3 <ng-container
4 [ngTemplateOutlet]="optionTemplate"
5 [ngTemplateOutletContext]="{ $implicit: option, idx: i }"
6 ></ng-container>
7</li>
8
9<!-- selector.component.html --><>Copy