Skip to content

Instantly share code, notes, and snippets.

@Piterden
Forked from ganqqwerty/app.component.ts
Created June 19, 2019 20:58
Show Gist options
  • Save Piterden/d21001bc19779c08ce98dd5c8cd12ffd to your computer and use it in GitHub Desktop.
Save Piterden/d21001bc19779c08ce98dd5c8cd12ffd to your computer and use it in GitHub Desktop.
ngOnInit() {
this.myForm = this.fb.group({
myCheckbox: [''],
myEmailField: [
'',
[
Validators.maxLength(250),
Validators.minLength(5),
Validators.pattern(/.+@.+\..+/),
],
],
})
}
onSubmit() {
console.log(this.myForm.value)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment