guylabs / ion-autocomplete

A configurable Ionic directive for an autocomplete dropdown
MIT License
264 stars 88 forks source link

how to get the selected object #222

Closed joanebrown closed 7 years ago

joanebrown commented 7 years ago

Hi! Amazing piece of code :)

I want to know if there is any way to get the selected object, since I want to display other attributes that are not within item-view-value-key

I used this for select only one element, so when i selected one element I want to change other elements with the attributes of the selected element..

sorry for my english :(

and thank you for your work!

guylabs commented 7 years ago

Hi

thanks for the praise! 👍

well you can use the https://github.com/guylabs/ion-autocomplete#the-items-clicked-method method to pass a callback in which you get the whole item selected and there you can change the model which is returned in the items-method such that you can adapt the items which are returned when you selected another one.

I hope I got your point but this is what you can do. If not could you please create a Codepen with an example of what you like to achieve? This would give a common ground to discuss upon.

Thanks and regards,

Guy

joanebrown commented 7 years ago

That's exactly what I want :)) thank you