File

src/app/shared/forms/cd-form-builder.ts

Description

CdFormBuilder extends FormBuilder to create an CdFormGroup based form.

Extends

FormBuilder

Index

Methods

Methods

group
group(controlsConfig: literal type, extra: literal type | null)
Parameters :
Name Type Optional Default value
controlsConfig literal type No
extra literal type | null No null
Returns : CdFormGroup
import { Injectable } from '@angular/core';
import { FormBuilder } from '@angular/forms';

import { ServicesModule } from '../services/services.module';
import { CdFormGroup } from './cd-form-group';

/**
 * CdFormBuilder extends FormBuilder to create an CdFormGroup based form.
 */
@Injectable({
  providedIn: ServicesModule
})
export class CdFormBuilder extends FormBuilder {
  group(
    controlsConfig: { [key: string]: any },
    extra: { [key: string]: any } | null = null
  ): CdFormGroup {
    const form = super.group(controlsConfig, extra);
    return new CdFormGroup(form.controls, form.validator, form.asyncValidator);
  }
}

result-matching ""

    No results matching ""