Skip to content

Instantly share code, notes, and snippets.

@Piterden
Forked from ganqqwerty/app.component.ts
Created June 19, 2019 21:02
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 Piterden/175a8f9b1e55e3e8a4800f06a7f5dc25 to your computer and use it in GitHub Desktop.
Save Piterden/175a8f9b1e55e3e8a4800f06a7f5dc25 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