1

Using Angular Chosen

https://github.com/localytics/angular-chosen

and testing out the following example

<select multiple
        chosen
        ng-model="state"
        ng-options="s.name for s in states">
  <option value=""></option>
</select>

However, I'm wondering as to how one would bind just the name value for a state object to ng-model?

The options presented will display just the state names, but when chosen, the entire state object is bound to ng-model rather than just the selected name.

Any thoughts would be much appreictaed as always!

user2085143
  • 4,162
  • 7
  • 39
  • 68

1 Answers1

1

You can try this format

select as label for value in array

eg. s.name as s.name for s in states