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:
harunurhan
2017-12-03 21:48:45 +01:00
committed by Miško Hevery
parent 71ea931df5
commit 941e88ff79
3 changed files with 26 additions and 4 deletions

View File

@ -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);
}