0

I am building an ionic4 app which uses ion-radio-group to display options from an array. My problem is when I try to select a single radio, all radios are selected. How can I select a single radio?

The code I am using is:

                <ion-radio-group [(ngModel)]="singleanswer">
                  <ion-item *ngFor="let answer of question.answers">
                      <ion-label>{{answer}}</ion-label>
                      <ion-radio value="answer">
                      </ion-radio>
                  </ion-item>
                </ion-radio-group>  
appdevnoobie
  • 219
  • 1
  • 3
  • 8

1 Answers1

0

Lol! there was a typo in the code.

<ion-radio value="answer">

was supposed to be

<ion-radio value="{{answer}}">
appdevnoobie
  • 219
  • 1
  • 3
  • 8