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

100% Statements 12/12
100% Branches 2/2
100% Functions 2/2
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2127x 27x   27x               27x 27x   248x   151x 151x   27x  
import { Injectable } from '@angular/core';
import { FormBuilder } from '@angular/forms';
 
import { CdFormGroup } from './cd-form-group';
 
/**
 * CdFormBuilder extends FormBuilder to create an CdFormGroup based form.
 */
@Injectable({
  providedIn: 'root'
})
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);
  }
}