ui-select2
ui-select2 copied to clipboard
Simple binding with Select2 data object option
I have changed the directive to always bind ng-model to the simple value returned by select2. I have also added a ui-data attribute that enables you to bind a property in your controller to the select2 data object if you need to access it.
Lets say select2 returns the object
{ id: 1, text: "My Selection" }
ng-model will equal 1 ui-data will equal
{ id: 1, text: "My Selection" }
This addresses the following issue
Unfortunately this change appears to break many of the tests.