Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created October 24, 2016 21:57
Show Gist options
  • Save NetanelBasal/88c5bbcc2f5a67a92079f20c462227ad to your computer and use it in GitHub Desktop.
Save NetanelBasal/88c5bbcc2f5a67a92079f20c462227ad to your computer and use it in GitHub Desktop.
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
}
]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment