* Creates a new `FormGroup` instance. * * @param controls A collection of child controls. The key for each child is the name * under which it is registered. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or an `AbstractControlOptions`
(
controls: TControl,
validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null,
asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null,
)
| 207 | * |
| 208 | */ |
| 209 | constructor( |
| 210 | controls: TControl, |
| 211 | validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, |
| 212 | asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null, |
| 213 | ) { |
| 214 | super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts)); |
| 215 | (typeof ngDevMode === 'undefined' || ngDevMode) && validateFormGroupControls(controls); |
| 216 | this.controls = controls; |
| 217 | this._initObservables(); |
| 218 | this._setUpdateStrategy(validatorOrOpts); |
| 219 | this._setUpControls(); |
| 220 | this.updateValueAndValidity({ |
| 221 | onlySelf: true, |
| 222 | // If `asyncValidator` is present, it will trigger control status change from `PENDING` to |
| 223 | // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable, |
| 224 | // so we set `emitEvent` to `true` to allow that during the control creation process. |
| 225 | emitEvent: !!this.asyncValidator, |
| 226 | }); |
| 227 | } |
| 228 | |
| 229 | public controls: ɵTypedOrUntyped<TControl, TControl, {[key: string]: AbstractControl<any>}>; |
| 230 |
nothing calls this directly
no test coverage detected