mardi 4 mai 2021

Angular 8 mat-radio-button checked dynamically

I checked my value using the attribute [checked] of mat-radio-button.

<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">
            
        </mat-radio-button>
    </mat-radio-group>
</div>

And as you can see the radio button with the id mat-radio-2 as ng-reflect-checked="true"

code

Is is not checked though.




Aucun commentaire:

Enregistrer un commentaire