Last active
March 8, 2017 20:26
-
-
Save matthieu-D/907224386168bc3b06fae6ef0973d3a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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