Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

single select - button text is not mapped correctly to the model value #94

Open
NithinBiliya opened this issue Nov 22, 2016 · 0 comments

Comments

@NithinBiliya
Copy link

NithinBiliya commented Nov 22, 2016

single select - button text is not mapped correctly to the model value

Object -

    $scope.fruits = [
                        {id: 1, name: 'Apple'},
                        {id: 2, name: 'Orange'},
                        {id: 3, name: 'Banana'}
                    ];

option string is - "c.id as c.name for c in fruits"

Plnkr link - link1

Select "Orange" in 2nd dropdown. The model value is set correctly to 2, but the button text is set to "Banana"

NithinBiliya pushed a commit to NithinBiliya/angular-multiselect that referenced this issue Nov 22, 2016
…o the model value amitava82#94

Possible fix for issue - Show only one property but select complete object amitava82#92

File changed - multiselect.js

Changes made -
Added a new function - getItemLabel(items,model)
Calling the above function in function getHeaderText()
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant