在mat-step中获取mat-radio-group的值

时间:2018-09-11 15:18:47

标签: angular angular-material2

我正在尝试逐步获取选定的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

0 个答案:

没有答案