Onclick event load ion-select option data


#1

Hi. Can you please give me an idea about this:

I tried to populate ion-select when it click.
At first it open without data then when I close and reopen manually the selectmenu, the option data shows…
How can I trigger click to close and open the alertcontroller in selectmenu?

Thanks…


#2

Please share some code of what you have tried.


#3

Hi @mhartington, Thank you. Here is the sample.

Sample Code:

loadLists() {
  this.car.getMakeList().then(res => {
     this.lists = res.makes;
  });
}

<ion-item>
    <ion-label>Car Makes</ion-label>
    <ion-select (click)="loadLists()">
        <ion-option *ngFor="let list of lists" value="{{ list.value }}">{{ list.label }}</ion-option>
    </ion-select>
</ion-item>


#4

just used an observable… maybe that is cheating?