@king-ds wrote:
Hi Ionites, would like to know the reason why selected parameter in ion-select-option is not working.
Here is the code snippet in html:
<ion-select multiple="true" [(ngModel)]="selectedData" (ionChange)="OnChange($event)" cancelText="Cancel" okText="Submit"> <ion-select-option *ngFor="let item of CDRS" [value]="item.id" [selected]="item.value" > {{ item.name }} </ion-select-option> </ion-select>
Please note that the item.value is boolean field.
From .ts file, this is the variable (CDRS) that I’m looping with.
this.CDRS = [ { id : 1, name : "value 1", value : true, }, ...
Anyone know how to check or select a certain ion-select-option using the selected field specially when its CDRS.value is set to true? Thanks.
Posts: 1
Participants: 1