Created
June 29, 2017 16:24
-
-
Save stevermeister/4015dce6441d413b9d781dfd67c499a5 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
const myNameValidator = (maxLength: number) => (control: FormControl) => { | |
const condition = !!control.value && control.value.length > maxLength; | |
if (!condition) { | |
return {myNameValidator: 'does not match the condition'} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment