0

如何按顺序验证: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) }]
  });

}

有什么优雅的方法可以按顺序完成验证吗?坦克!

4

0 回答 0