angular-strap icon indicating copy to clipboard operation
angular-strap copied to clipboard

Typeahead with objects without label property

Open vlad-nica opened this issue 12 years ago • 9 comments

Hi,

I have a problem with the source array of a typeahead. If the elements don't have a "label" property, after selecting a match the input becomes empty. Isn't it possible to use directly the label specified in ngOption? e.g. state.Name is the label of ng-options="state as state.Name for state in getState($viewValue, statesWoLabels)" Same problem when the model already has a selected value without a label property.

Also it will be very helpful if the documentation will include examples of how to use complex objects in typeaheads because I struggled a lot to find how to obtain the desired behavior (like in the following plunker).

And here's the plunker: http://plnkr.co/edit/maueceKX47Mu5RhfpIF5

Thanks!

vlad-nica avatar Oct 17 '14 08:10 vlad-nica

+1

cgarvis avatar Oct 29 '14 16:10 cgarvis

+1

DealerCorp avatar Oct 30 '14 22:10 DealerCorp

+1

giolvani avatar Oct 31 '14 15:10 giolvani

+1

jasas1 avatar Nov 17 '14 18:11 jasas1

+1

cjthomp avatar Nov 17 '14 18:11 cjthomp

+1

m0ngr31 avatar Nov 17 '14 18:11 m0ngr31

Typeahead uses the ng-options, so something else is going on.

vmlf01 avatar Nov 19 '14 13:11 vmlf01

It should be fixed with #1261 and version v2.1.4

dinoboff avatar Dec 01 '14 21:12 dinoboff

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 26 '19 11:01 lock[bot]