如何解决在Angular中更改另一个组的事件时更改组的切换状态
我有一个测验应用程序的场景,在该场景中,我选择一个答案,然后转到下一个问题,依此类推。 现在,当我回到旧问题时,它希望它向我显示我在该问题上选择的答案。我找不到解决方法。另外,我检查了其他答案,但是没有一个帮助。
HTMLCode:
<mat-button-toggle-group (change)="toggleChangeQuestion($event)" name="selectQuestions" #group2="matButtonToggleGroup">
<mat-button-toggle checked value="0">01</mat-button-toggle>
<mat-button-toggle value="1">02</mat-button-toggle>
<mat-button-toggle value="2">03</mat-button-toggle>
<mat-button-toggle value="3">04</mat-button-toggle>
<mat-button-toggle value="4">05</mat-button-toggle>
</mat-button-toggle-group>
<mat-button-toggle-group multiple (change)="toggleChange($event)" name="answers" #group1="matButtonToggleGroup">
<mat-button-toggle value="a">A</mat-button-toggle>
<mat-button-toggle value="b">B</mat-button-toggle>
<mat-button-toggle value="c">C</mat-button-toggle>
<mat-button-toggle value="d">D</mat-button-toggle>
</mat-button-toggle-group>
如何在#group2按钮的拨动开关上控制/更改#group1按钮的选中状态?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。