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

100% Statements 13/13
50% Branches 1/2
100% Functions 2/2
100% Lines 10/10

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
    21
    2225x
    25x

    25x
    25x

    25x
    25x

    162x

    81x
    81x

    25x
     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 },
        Eextra: { [key: string]: any } | null = null
      ): CdFormGroup {
        const form = super.group(controlsConfig, extra);
        return new CdFormGroup(form.controls, form.validator, form.asyncValidator);
      }
    }