Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Last active March 8, 2017 20:26
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 matthieu-D/907224386168bc3b06fae6ef0973d3a5 to your computer and use it in GitHub Desktop.
Save matthieu-D/907224386168bc3b06fae6ef0973d3a5 to your computer and use it in GitHub Desktop.
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
export class HomeComponent {
userForm: FormGroup;
constructor (formBuilder: FormBuilder) {
this.userForm = formBuilder.group({
name: ['', Validators.required],
email: '',
address: formBuilder.group({
country: '',
city: '',
})
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment