ngTemplateOutlet with dynamic value
Add these to the components class
@ViewChild('one') one:TemplateRef<any>;
@ViewChild('two') two:TemplateRef<any>;
and get the template references using
<form no-validate (ngSubmit)="onSubmit(search)">
<ng-container *ngFor="let part of objectKeys(config);">
<ng-container *ngIf="config[part]">
<ng-container [ngTemplateOutlet]="this[part]"></ng-container>
</ng-container>
</ng-container>
</form>
StackBlitz example