Dynamic Tagging in ng-template and use with ng-container *ngTemplateOutlet

Viewed 440

I have an *ngFor which iterates through users like:

<div *ngFor="let user of users>

</div>

I want to create ng templates like this:

<div *ngFor="let user of users>
   <ng-template #{{user.id}}> (is there a way to do that...?)
        --------call a component
   </ng-template>
</div>

and use them like this inside different components of my project

<div *ngFor="let user of users>
   <ng-container *ngTemplateOutlet="user.id">
   </ng-container>
</div>

So, my question is, can i declare tags dynamically to ng-template ?

0 Answers
Related