如何依次验证:v1,v2,v3并一次显示一个错误。
this.form = this.formService.group({
input1: new FormControl('', [Validators.required])
}, {
validator: [(formGroup: FormGroup) => { return this.v1(formGroup) },
(formGroup: FormGroup) => { return this.v2(formGroup) },
(formGroup: FormGroup) => { return this.v3(formGroup) }]
});
}
是否有任何优雅的方法可以按顺序进行验证? TNK!