const componentMapper = {
input: InputComponent,
button: ButtonComponent,
select: SelectComponent,
date: DateComponent,
radiobutton: RadiobuttonComponent,
checkbox: CheckboxComponent,
switch: SwitchComponent,
textarea: TextAreaComponent
};
const compFactory = this.resolver.resolveComponentFactory(componentMapper[this.field.type]);
What is strict type for const compFactory
2
Answers
The type of
compFactory
isSince there can be multiple component, best to go for
any
type. Since its more readable.Stackblitz Demo