I am attempting to retrieve the value of each selected radio button from every group that follows in a row.
<button ion-button (click)="sample()">Test</button>
<ion-list *ngFor="let item of test; let i = index">
<ion-item text-wrap padding no-lines>
<h2>{{i + 1}}. {{item.Ask}}</h2>
</ion-item>
<form [formGroup]="regis_form">
<ion-list radio-group formControlName="uanswer" [(ngModel)]="test['uanswer'+i]">
<ion-item >
<ion-label>A. {{item.Alt_Ans_1}}</ion-label>
<ion-radio value="A" name="uanswer"></ion-radio>
</ion-item>
<ion-label>B. {{item.Alt_Ans_2}}</ion-label>
<ion-radio value="B" name="uanswer"></ion-radio>
</ion-item>
<ion-label>C. {{item.Alt_Ans_1}}</ion-label>
<ion-radio value="C" name="uanswer"></ion-radio>
</ion-item>
</form>
</ion-list>
Example
1.Question 1
A. Ant
B. Bat
C. Cat
Question 2
A.Dog
B.Eagle
C.Donkey
JS
sample(){
console.log(this.uanswer)
}
How can I fetch the values of all selected radio buttons from the list and display them in the console?