Let's say that I have a list of elements. The first one is a course, the second is an exam and the third is a course again and the fourth is a curriculum.
I want to show this list. So I make a loop with *ngFor, and I have 3 different components for my list items.
I'm looking for the best solution.
<div *ngFor="let item of items">
<course [item]="item" *ngIf="item.type == 1"></course>
<exam [item]="item" *ngIf="item.type == 2"></exam>
<curriculum [item]="item" *ngIf="item.type == 3"></curriculum>
</div>
It doesn't seems to be the best solution.