* Creates a new `FormArray` instance. * * @param controls An array of child controls. Each child control is given an index * where it is registered. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or an `AbstractControlOptions` object t
(
controls: Array<TControl>,
validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null,
asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null,
)
| 137 | * |
| 138 | */ |
| 139 | constructor( |
| 140 | controls: Array<TControl>, |
| 141 | validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, |
| 142 | asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null, |
| 143 | ) { |
| 144 | super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts)); |
| 145 | this.controls = controls; |
| 146 | this._initObservables(); |
| 147 | this._setUpdateStrategy(validatorOrOpts); |
| 148 | this._setUpControls(); |
| 149 | this.updateValueAndValidity({ |
| 150 | onlySelf: true, |
| 151 | // If `asyncValidator` is present, it will trigger control status change from `PENDING` to |
| 152 | // `VALID` or `INVALID`. |
| 153 | // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent` |
| 154 | // to `true` to allow that during the control creation process. |
| 155 | emitEvent: !!this.asyncValidator, |
| 156 | }); |
| 157 | } |
| 158 | |
| 159 | public controls: ɵTypedOrUntyped<TControl, Array<TControl>, Array<AbstractControl<any>>>; |
| 160 |
nothing calls this directly
no test coverage detected