Created
June 27, 2020 14:27
-
-
Save Dornhoth/9dd739d10decc5313572bd9935c99894 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
@Directive({ | |
selector: '[myValidator]', | |
providers: [{ | |
provide: NG_VALIDATORS, | |
useExisting: MyValidatorDirective, | |
multi: true, | |
}] | |
}) | |
class MyValidatorDirective implements Validator { | |
validate(control: AbstractControl): ValidationErrors | null { | |
return { 'myValidator': true }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment