Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function buildField({ model, options, form: formControl, ...field }: FormlyFieldConfigCache): FormlyFieldConfigCache {
const builder = createBuilder({
extensions: ['core', 'validation'],
onInit: c =>
c.addConfig({
validators: [
{ name: 'required', validation: Validators.required },
{ name: 'asyncRequired', validation: ctrl => of(Validators.required(ctrl)) },
],
}),
});
field = { key: 'name', ...field };
builder.buildField({
model: model || {},
options,
formControl,
function buildField({ model, options, ...field }: FormlyFieldConfig): FormlyFieldConfigCache {
const builder = createBuilder({
extensions: ['core'],
onInit: c =>
c.addConfig({
types: [
{
name: 'input',
wrappers: ['form-field'],
component: MockComponent({ selector: 'formly-test-cmp' }),
},
],
}),
});
builder.buildField({
model: model || {},
options,