1<form [formGroup]="form">
2 <label>
3 <input type="radio" value="Male" formControlName="gender">
4 <span>male</span>
5 </label>
6 <label>
7 <input type="radio" value="Female" formControlName="gender">
8 <span>female</span>
9 </label>
10</form>
11
1 form: FormGroup;
2 constructor(fb: FormBuilder) {
3 this.name = 'Angular2'
4 this.form = fb.group({
5 gender: ['', Validators.required]
6 });
7 }
8