-1

I am unable to understand as to why the following code is unable to display the selected value. Any help is really appriciated.

<select ui-select2 ng-model="associations" style="width:200px" multiple 
   ng-options="whse.WarehouseName for whse in allWarehouses">
</select>

I see the associations is properly updated with the selection and also the selection list is working as expected, however the selected value in not displayed.

i have a working example here : http://plnkr.co/edit/cd7ceZC6AMluBWQh6Swu?p=preview

Thanks Kiran

Kiran
  • 2,997
  • 6
  • 31
  • 62

3 Answers3

0

ui-select2 is incompatible with ng-options

See https://github.com/angular-ui/ui-select2#working-with-dynamic-options

migajek
  • 8,524
  • 15
  • 77
  • 116
  • issue with using ng-repeat is that I can't get the selected object, it converts it to only the display string. is it possible to get the selected object fully? – Kiran Dec 19 '13 at 17:10
0

You can give select2 your selection values in the data option. http://ivaynberg.github.io/select2/

  • I don't really see how to get the selected values using the data option. would it be possible to point me to an example or may be edit the above plnkr to illustrate how I could use it? - Thanks – Kiran Dec 20 '13 at 03:18
0

In your script.js file, let modify "ui.select2" to only "ui". That would be ok.