Skip to content

Instantly share code, notes, and snippets.

@ganqqwerty
Last active June 19, 2019 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ganqqwerty/aace059c1c2505a6a65539f2c4c8d92c to your computer and use it in GitHub Desktop.
Save ganqqwerty/aace059c1c2505a6a65539f2c4c8d92c to your computer and use it in GitHub Desktop.
private emailValidators = [
Validators.maxLength(250),
Validators.minLength(5),
Validators.pattern(/.+@.+\..+/)
];
ngOnInit() {
this.myForm = this.fb.group({
myCheckbox: [''],
myEmailField: ['', this.emailValidators]
})
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment