【发布时间】:2021-07-26 14:09:24
【问题描述】:
我使用mat-radio-button 的属性[checked] 检查了我的值。
<div class="mb-3" *ngIf="!multiple" class="ttb-filter-list">
<mat-radio-group class="d-flex flex-column" aria-labelledby="group-radio" [(ngModel)]="radioValue">
<mat-radio-button *ngFor="let option of filteredOptions | async" [value]="option" color="primary" [checked]="option.checked">
{{ option.name }}
</mat-radio-button>
</mat-radio-group>
</div>
您可以看到 ID 为 mat-radio-2 的单选按钮为 ng-reflect-checked="true"
Is 没有被检查。
【问题讨论】:
-
能否请你为它创建一个stackBlitz?!
-
请提供 stackblitz 链接。
-
你能显示
filteredOptions数组
标签: javascript angular checkbox angular8