How to use ngTemplateOutlet with context ?

Note

ngTemplateOutlet allows you to dynamically render templates in your Angular components, which can be very useful for creating reusable and flexible UI components.

<ng-template #myTemplate let-name="name">
    <div>hello {{name}}</div>
</ng-template>

<ng-container *ngTemplateOutlet="myTemplate; context: {name: 'Angular CookBook'}">
</ng-container>

or

<ng-container [ngTemplateOutlet]="myTemplate" [ngTemplateOutletContext]="{name: 'Angular CookBook'}">
</ng-container>