Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular-ui typeahead select id instead of object

I'm trying to set an id in the typeahead instead an object and it doesn't work like a select element.

Here is an example, where you can write the correct word in the typeahead, and then the select element is updated, but if you change the select, the typeahead isn't updated with the name, is updated with the id instead.

http://plnkr.co/edit/LJqdebViiucCv6X5hhtf?p=preview

I'm doing something wrong?

like image 580
TlmaK0 Avatar asked Jun 03 '13 17:06

TlmaK0


1 Answers

What about something like that?

http://plnkr.co/edit/pUPzVK?p=preview (check the typehead and ng-options definition)

What you "did wrong" is missing the info, that typehead doesn't have exactly the same definition as ng-options (I've struggled with this for a while too).

Hope this helps

like image 66
JakubKnejzlik Avatar answered Oct 20 '22 12:10

JakubKnejzlik