Can't bind to 'ngTemplateOutletContext' since it isn't a known property of 'ng-container'.
Dung Do Tien Jan 28 2021 451
I have built the project with angular 11 and getting the following error when working with ngTemplateOutletContext
Any idea how to handle?
Have 1 answer(s) found.
- H1
Huyền Trần thị Jan 27 2021
Here is the correct syntax, when you want to send the dynamic data to ng-template as input/variable using ngTemplateOutletContext like
<ng-container [ngTemplateOutlet]="templateName" [ngTemplateOutletContext]="{$implicit: 'Hi', object: 'abcxyz}"> </ng-container> <ng-template #templateName let-default let-object="object"> {{default}} {{object}} </ng-template>
Hope resolve for you!
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.