]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-builder.ts
import ceph 16.2.7
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / forms / cd-form-builder.ts
CommitLineData
11fdf7f2 1import { Injectable } from '@angular/core';
a4b75251 2import { AbstractControlOptions, FormBuilder } from '@angular/forms';
11fdf7f2 3
11fdf7f2
TL
4import { CdFormGroup } from './cd-form-group';
5
6/**
7 * CdFormBuilder extends FormBuilder to create an CdFormGroup based form.
8 */
9@Injectable({
81eedcae 10 providedIn: 'root'
11fdf7f2
TL
11})
12export class CdFormBuilder extends FormBuilder {
13 group(
14 controlsConfig: { [key: string]: any },
a4b75251 15 extra: AbstractControlOptions | null = null
11fdf7f2
TL
16 ): CdFormGroup {
17 const form = super.group(controlsConfig, extra);
18 return new CdFormGroup(form.controls, form.validator, form.asyncValidator);
19 }
20}