Guest User

Untitled

a guest
Jan 16th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import { FormGroup, FormControl, Validators } from '@angular/forms';
  2.  
  3. class ModelFormComponent implements OnInit {
  4. myform: FormGroup;
  5.  
  6. ngOnInit() {
  7. myform = new FormGroup({
  8. name: new FormGroup({
  9. firstName: new FormControl('', Validators.required),
  10. lastName: new FormControl('', Validators.required),
  11. }),
  12. email: new FormControl('', [
  13. Validators.required,
  14. Validators.pattern("[^ @]*@[^ @]*")
  15. ]),
  16. password: new FormControl('', [
  17. Validators.minLength(8),
  18. Validators.required
  19. ]),
  20. language: new FormControl()
  21. });
  22. }
  23. }
Add Comment
Please, Sign In to add comment