Created
October 24, 2016 21:57
-
-
Save NetanelBasal/88c5bbcc2f5a67a92079f20c462227ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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