Currently, I have the following code that is functioning well up to a certain point. However, I am encountering a small issue that I cannot seem to resolve. The problem lies in updating the ion-select after the user selects an option. Essentially, the UI does not reflect the selected value. Any suggestions on how to fix this?
<ion-item>
<ion-label>Classifications</ion-label>
<ion-select [(ngModel)]="selectedItem" #item (change)="onChange(selectedItem)">
<ion-option *ngFor="#item of items" [value]="item">{{item}}</ion-option>
</ion-select>
</ion-item>
onChange(selectedItem) {
console.log('Selected item: '+selectedItem);
}
The output properly displays as the user selects, but any thoughts on what might be missing here?
Update:
<ion-item>
<ion-label>Gender</ion-label>
<ion-select [(ngModel)]="gender">
<ion-option value="f" checked="true">Female</ion-option>
<ion-option value="m">Male</ion-option>
</ion-select>
</ion-item>