TS
roomList = [{
name: 'Room2'
}]
HTML
<div class="Layout-body">
<ng-container *ngFor="let dt of roomList; index as i" [ngTemplateOutlet]="Room1" [ngTemplateOutletContext]="{ data: dt, i: i }" >
</ng-container>
</div>
<ng-template #Room1 let-data="data" let-i="index">
{{data}}
</ng-template>
<ng-template #Room2 let-data="data" let-i="index">
{{data}}
</ng-template>
Is there a way to dynamically display the template based on the value of the roomList object? For example, if the name is 'Room2', then Room2 template will be displayed in the ngTemplateOutlet.