title: Component template inside another component
body: <p>I have array of components stored in main component. They are of different types. I used ngFor and ngSwitch directives to display them all.</p>
  
  <pre><code>&lt;div *ngFor="let component of components"
           [ngSwitch]="component.id"&gt;
          &lt;component-a *ngSwitchCase="1"&gt;&lt;/component-a&gt;
          &lt;component-b *ngSwitchCase="2"&gt;&lt;/component-b&gt;
          &lt;component-c *ngSwitchCase="3"&gt;&lt;/component-c&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This approach is quite problematic when I add new type, e.g. ComponentX, beacuse I have to add another ngSwitch case. Is there any possibility to make it more generic?</p>