I am making an app in Angular and am currently working on a forms section. With the help of a custom ngFormModel I have can generate per defined forms with validation simply with the following:
<form [ngFormModel]="customForm" (ngSubmit)="updateUser()">
<input [ngFormControl]="customForm.controls['name']" type="text">
<input [ngFormControl]="customForm.controls['email']" type="text>
<button *ngIf="customForm.dirty" type="submit">Save</button>
</form>
This works quite awesome, default values for my pre defined form are automatically shown and my form is updated when I submit the values. I have not been able to get input types radio and select up and running with ngFormControl. Is it possible that this isn't supported out of the box in Angular 2? Isn't this a quite fundamental part of forms?
Edit: maybe relevant to show how the form is generated:
this.customForm = this.form.group({
'name': [this.user.first_name],
'email': [this.user.email]});