Can we store both the text and value field in the ng-model ?
I need to use the select input's selected item's text for validation. So, I can use this either by storing both text/value in the ng-model or get the text of the select input via api call or something like getText()
+1 Need ability to have model set as multi-keyed object
Actually, I think ngModel should hold the options objects, as it does in the AngularJS select directive (and in angular-chosen-localytics). Currently, it only holds the selected values, so when the options are objects, we have to find back which ones are selected.
Problem: that would be a breaking change. So this capability would have to be activated by an option.
Is there a workaround to this, very similar if not the same as what I'm asking here :
http://stackoverflow.com/questions/32911621/angular-selectize-bind-to-model-not-value
The workaround is as I wrote: you have a list of options, ngModel provides the value(s) (key(s)), you search the item in the list with this key (these keys). It is quite trivial with Lodash or similar, and generally fast enough.
Thank you Philippe. I was originally using the ui-select plugin which did this out of the box without needing a workaround.
It's too slow when I have ~1500 options, not a problem with angular-selectize though.
+1
+1 Really missing this feature. There's many use cases when you'd like to store the whole object and not a single property value. Like @PhiLhoSoft it should be added as an option.
any news on this?