Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevermeister/4015dce6441d413b9d781dfd67c499a5 to your computer and use it in GitHub Desktop.
Save stevermeister/4015dce6441d413b9d781dfd67c499a5 to your computer and use it in GitHub Desktop.
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