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

Dynamically add an "Option" (multiselect+ajax) #302

Open ghost opened 8 years ago

ghost commented 8 years ago

I used to have select2+jquery in my website, but I've decided to switch to angular. This used to be my code:

var option = new Option("id", "text"); $("select").append(option);

But now I have no idea how to add an option to select2 manually. Can you give me a solution?

Thanks