首页 > 解决方案 > 在 IE11 中更新 ngModel 后触发 ngbRadioGroup 点击事件

问题描述

我正在使用 a ngbRadioGroup,并且单选组中的每个输入都有一个单击事件,以便可以取消选择输入:

<div ngbRadioGroup class="btn-group-toggle" name="myGroup" [(ngModel)]="myModel" [disabled]="this.hasSubmittedAnswer">
    <label ngbButtonLabel *ngFor="let choice of currentActivity.choices" class="btn btn-outline-primary btn-lg mr-2">
        <input ngbButton type="radio" [value]="choice" (click)="onAnswerSelected(choice)"> {{ choice }}
    </label>
</div>

在 Chrome 73 中,点击事件会在模型更新之前触发。在 IE11 中,“myModel”在“onAnswerSelected”触发之前更新。

有什么方法可以在 IE11 中更新模型之前触发事件?

标签: angularng-bootstrap

解决方案


推荐阅读