import { Directive, forwardRef } from "@angular/core";
import { NG_ASYNC_VALIDATORS, Validator, AbstractControl } from "@angular/forms";
import { Observable } from "rxjs";
@Directive({
selector: "[asyncValidator][formControlName], [asyncValidator][ngModel]",
providers: [
{
provide: NG_ASYNC_VALIDATORS,
useExisting: forwardRef(() => AsyncValidator), multi: true
}
]
})