angular-ui / ui-select2

AngularJS wrapper for select2 (deprecated, use angular-ui/ui-select)
https://github.com/angular-ui/ui-select
MIT License
595 stars 444 forks source link

how to select a selected item? #273

Open ghost opened 10 years ago

ghost commented 10 years ago

Hi,

Sorry but can't seem to find how to select(click) a item that has been selected.

I have my list, I select an item, then it displays as it should, now I'd like to be able to select that item with a click. On that event I want to style the selected item differently. Unfortunately i can't find the event that permits to do that

Any directions would be most welcome.

thanks

JesusMurF commented 9 years ago

I have the same question, have you resolved it? thanks.

EDIT: Finally I have found the solution, you have to instanciate the empty object within the controller. Because before this, the object doesn't exist.

$scope.nameOfTheModel = {};  // Need to instantiate model within controller.

Regards.