UNPKG

@codeforges/ng-forms

Version:

Angular 4+ Dynamic form builder, decorate your models to generate forms or create them manually

22 lines 920 B
import { TextInput } from "../TextInput"; import { TextAreaInput } from "../TextAreaInput"; import { SelectInput } from "../SelectInput"; import { CheckboxInput } from "../CheckboxInput"; import { RadioInput } from "../RadioInput"; export class BaseInputFactory { static build(className, fieldName, params) { switch (className) { case TextInput.name: return new TextInput(fieldName, params); case CheckboxInput.name: return new CheckboxInput(fieldName, params); case TextAreaInput.name: return new TextAreaInput(fieldName, params); case SelectInput.name: return new SelectInput(fieldName, params.selectOptions, params); case RadioInput.name: return new RadioInput(fieldName, params.selectOptions, params); } } } //# sourceMappingURL=BaseInputFactory.js.map