How to configure ion-select to return an object rather than its display property


#1

Hello,
I am using the ion-select to allow an user to select and return multiple options. my code snippet runs as below:

  <ion-select [(ngModel)]="msg.pubLocs" multiple="true" okText="Okay" cancelText="Cancel">
          <ion-option *ngFor="let loc of locs.locs">{{loc.name}}</ion-option>
 </ion-select>

loc.name” had been used just for displaying purpose. My intention is to have the ion-selection returning a list of the selected “loc”; yet it currently returns a list of selected “loc.name” ( which is a property of an object “loc”)

so my question is: how may I be able to configure the ion-select to return the “loc”?

thanks


#2

Hello,

I am facing the same issue now, did you find a solution to this?

Thanks,


#3

<ion-option [value]="thingy">{{thingy.name}}</ion-option>