Answers for "ngtemplateoutlet"

0

ngtemplateoutlet

<!-- Alternative syntax -->
<ng-container
  *ngTemplateOutlet="optionTemplate; context:{ $implicit: option, idx: i }"
></ng-container>
><Copy
Posted by: Guest on February-21-2021
0

ngtemplateoutlet

<!-- Define our template -->
<ng-template #myTemplate> World! </ng-template>

Hello
<!-- Render the template in this outlet -->
<ng-container [ngTemplateOutlet]="myTemplate"></ng-container>
<>Copy
Posted by: Guest on February-21-2021
0

ngtemplateoutlet

<ng-template #optionTemplate let-option let-position="idx">
  {{ position }} : {{option}}
</ng-template>

<!-- client-one.component.html --><>Copy
Posted by: Guest on February-21-2021
0

ngtemplateoutlet

<li *ngFor="let item of items; index as i">
  <!-- Setting the option as the $implicit property of our context along with the row index -->
  <ng-container
    [ngTemplateOutlet]="optionTemplate"
    [ngTemplateOutletContext]="{ $implicit: option, idx: i }"
  ></ng-container>
</li>

<!-- selector.component.html --><>Copy
Posted by: Guest on February-21-2021

Code answers related to "ngtemplateoutlet"

Browse Popular Code Answers by Language