<form #reservationForm="ngForm" (ngSubmit)="createReservation(reservationForm)">
<ion-item class="ion-no-padding" *ngFor="let item of items.services | keyvalue">
<ion-radio value="{{item.key}}" class="ion-no-margin" name="itemRadio" ngModel></ion-radio>
</ion-item>
</form>
module.ts:
createReservation(formData: NgForm) {
console.log(formData.value);
}
] [console.log]: {
[ng] "item": true
[ng] }
出什么问题了?
谢谢
答案 0 :(得分:0)
我解决了我的问题。
<ion-radio-group allow-empty-selection="false" name="radioGroup" ngModel name="radioGroup">
然后
console.log(reservationForm.value);