-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Closed
Description
Type: bug
Ionic Version: 2.x
Platform: all
If you have the following code:
<ion-item>
<ion-label>Watering Mode</ion-label>
<ion-select [(ngModel)]="zone.kind">
<ion-option *ngFor="#key of modeKeys">{{key}}</ion-option>
</ion-select>
</ion-item>
and
this.zone = {
kind: 'key2'
}
this.modeKeys = [
'key1',
'key2',
'key3',
'key4',
]
A select component is displayed with 'key2' shown as selected.
But if you change the data to this:
this.zone = {
kind: 2
}
this.modeKeys = [
1,
2,
3,
4,
]
It does not work. Seems the component prefer strings.
https://forum.ionicframework.com/t/ion-select-with-dynamic-options/43720/7
Metadata
Metadata
Assignees
Labels
No labels