填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

AsyncValidatorFn

本函数接收控件并返回 Promise 或 Observable,如果存在,则该函数会发出验证错误,否则为 null。

A function that receives a control and returns a Promise or observable that emits validation errors if present, otherwise null.

      
      interface AsyncValidatorFn {
  (control: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null>
}
    

方法

      
      (control: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null>
    
参数
control AbstractControl
返回值

Promise<ValidationErrors | null> | Observable<ValidationErrors | null>