Angular - ng-template with parameter inside ngIf inside ngFor [duplicate]
This question already has an answer here: Passing ngFor variable to an ngIf template 3 answers I am trying to build this template: <ul> <li *ngFor='let link of links'> <ng-container *ngIf="link.type == 'complex'; then complexLink else simpleLink"></ng-container> </li> </ul> <ng-template #simpleLink> ... {{ link.some_property }} </ng-template> <ng-template #complexLink> ... {{ link.some_property }} </ng-template> The problem is that the link variable is undefined inside the ng-template so I get an error of accessing 'some_property' of undefined. I am struggeling to understand how I pass the