AlexisCraig
AlexisCraig

Reputation: 526

Can't use ion-select

I use ionic to create an android mobile application. But I have a problem with the select. On the site of ionic, it can be seen that in the documentation, you can use <ion-select>, but strangely, when I try to use it nothing happens. The result is not the one expected, because it has no effect. <ion-select> is not triggering..

So I am forced to use this for now:

<select ng-model="form.city">
      <option value="">Select</option>
      <option ng-repeat="c in city" ng-value="c.id">{{c.name}}</option>
</select>

While I would like to have the same result as on the official website, with <ion-select>

Upvotes: 1

Views: 1531

Answers (2)

Kiran Chenna
Kiran Chenna

Reputation: 1729

Try This its working fine for me

<ion-list>
    <ion-item>
      <ion-label>Users List</ion-label>
      <ion-select [(ngModel)]="myUser" placeholder="Select your User">
        <ion-option *ngFor="let user of users; let i = index" ng-value="user.id" >
          {{user.name}}
        </ion-option>
      </ion-select>
    </ion-item>
  </ion-list>

Upvotes: 0

Zohra Gadiwala
Zohra Gadiwala

Reputation: 216

Try this

<ion-select [(ngModel)]="form.city">
  <ion-option *ngFor="c in city" value="{{c.id}}">
    {{c.name}}
  </ion-option>
</ion-select>

Upvotes: 0

Related Questions