Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { FormGroup, FormControl, Validators } from '@angular/forms';
- class ModelFormComponent implements OnInit {
- myform: FormGroup;
- ngOnInit() {
- myform = new FormGroup({
- name: new FormGroup({
- firstName: new FormControl('', Validators.required),
- lastName: new FormControl('', Validators.required),
- }),
- email: new FormControl('', [
- Validators.required,
- Validators.pattern("[^ @]*@[^ @]*")
- ]),
- password: new FormControl('', [
- Validators.minLength(8),
- Validators.required
- ]),
- language: new FormControl()
- });
- }
- }
Add Comment
Please, Sign In to add comment