I need some advice. I'm developing a dashboard in Angular2. My project can have different types and I want to display a component relating to each of these types.
This is how I do for now:
<div *ngIf="project.types.type1">
<app-type1></app-type1>
</div>
<div *ngIf="project.types.type2">
<app-type2></app-type2>
</div>
<div *ngIf="project.types.type3">
<app-type3></app-type3>
</div>
But I would like to know if it's possible to write it in a more elegant way that could look this:
<div *ngFor="let key of project.types | keys">
<template name="app-{{key}}></template>
</div>
Thanks