I swear I had this working some time ago but trying to use [formControlName]
on a ion-radio
breaks rendering of the entire form.
What I had before:
<ion-list *ngIf="question.controlType === 'radio'"
(ionChange)="manageDecisionButton($event)"
[formControlName]="question.key"
radio-group
item-content
style="width:100%">
<ion-item *ngFor="let opt of question.options">
<ion-label>{{ opt.display }}{{ opt.description ? ' - ' + opt.description : '' }}</ion-label>
<ion-radio [value]="opt.value"></ion-radio>
</ion-item>
</ion-list>
I spent my whole day yesterday figuring out that it was the [formControlName]
directive that was causing the problem (without any errors :/). If I move it to the <ion-radio>
element the space is rendered for the radios, but the label is not rendered and the radios are not selectable.
Anyone have model driven forms working with ion-radios?
Edit: Actually looks like ionic is failing to add .radio-checked
to the wrapping div to the radio ‘dot’