feat(forms): multiple validators for array method (#20766)
Change array method signature so that array of validator and/or async validatior functions can be passed. Fixes #20665 PR Close #20766
This commit is contained in:
@ -64,8 +64,8 @@ export class FormBuilder {
|
||||
* configuration, with the given optional `validator` and `asyncValidator`.
|
||||
*/
|
||||
array(
|
||||
controlsConfig: any[], validator?: ValidatorFn|null,
|
||||
asyncValidator?: AsyncValidatorFn|null): FormArray {
|
||||
controlsConfig: any[], validator?: ValidatorFn|ValidatorFn[]|null,
|
||||
asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormArray {
|
||||
const controls = controlsConfig.map(c => this._createControl(c));
|
||||
return new FormArray(controls, validator, asyncValidator);
|
||||
}
|
||||
|
Reference in New Issue
Block a user