In my current code, I have an array called resourceTypes and I am using ngSwitch to create different components/directives based on the TypeName. However, I find this approach cumbersome as I have to update the code every time I add a new resource editor. How can I refactor the code so that the correct resource-editor is created automatically based on the type without relying on ngSwitch? I have considered using ng-content, but I'm struggling to implement it effectively.
TL;DR: How can I improve the code below to eliminate the need for ngSwitch and dynamically link the type to a component?
<div *ngFor="let aType of resourceTypes; let i = index" role="tabpanel" class="tab-pane" [ngClass]="{'active': i==0}" [attr.id]="aType.Name">
<span *ngSwitch="aType.Name">
{{aType.Name}} tab content here
<config-resource-editor [application]="application" ngSwitchWhen="Config" template></config-resource-editor>
<mvc-resource-editor [application]="application" ngSwitchWhen="MVC" template></mvc-resource-editor>
<other-resource-editor [application]="application" ngSwitchWhen="Other" template></other-resource-editor>
<wcf-resource-editor [application]="application" ngSwitchWhen="WCF" template></wcf-resource-editor>
<web-resource-editor [application]="application" ngSwitchWhen="Web" template></web-resource-editor>
<webapi-resource-editor [application]="application" ngSwitchWhen="WebAPI" template></webapi-resource-editor>
</span>
</div>