*ngTemplateOutlet inside ngFor code example
Example 1: ngtemplateoutlet
<!-- Define our template -->
<ng-template #myTemplate> World! </ng-template>
Hello
<!-- Render the template in this outlet -->
<ng-container [ngTemplateOutlet]="myTemplate"></ng-container>
<>Copy
Example 2: ngtemplateoutlet
<!-- Alternative syntax -->
<ng-container
*ngTemplateOutlet="optionTemplate; context:{ $implicit: option, idx: i }"
></ng-container>
><Copy