我正在尝试逐步获取选定的radio button
值,这是我的代码。
<mat-horizontal-stepper #stepper (selectionChange)="stepperChange($event)" style="max-width: 650px;">
<mat-step *ngFor="let question of userQuestionDetails; let i = index " formGroupName="{i}">
<div style="display: flex;">
<button mat-mini-fab style="margin-left: 20px; margin-top: 4px;">
<mat-icon aria-label="Example icon-button with a heart icon">favorite</mat-icon>
</button>
</div>
{{question.question_text}}
<p></p>
<mat-radio-group class="radio-group">
<mat-radio-button class="radio-button" *ngFor="let choice of question.choices" [value]="choice.id" (change)="onChangeOfQuestionRadio(question, choice.id)">
{{choice.value}}
</mat-radio-button>
</mat-radio-group>
</mat-step>
</mat-horizontal-stepper>
对于上面的代码,我需要为所有r radio button
选择adio groups
。