-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Using objects in <ui-select-choices repeat=""> #971
Comments
👍trying to find information on the same thing right now. |
@Andrewpk did you manage to figure out a solution? Changing the object to an array is a last resort for me for performance reasons. |
I just ended up switching to angular-chosen which supports both arrays and objects as data sources.
|
Agreed, I think this is a major limitation. The source clearly expects items to be in the "item in array" with an optional track by: see line 1774 var match = expression.match(/^\s_(?:([\s\S]+?)\s+as\s+)?([\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s_$/); This can be changed to var match = expression.match(/^\s_(?:([\s\S]+?)\s+as\s+)?([\S]+?)\s+._\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/); and will pick up matches, but further modifications are needed in order to return items, haven't looked into it any further. It wold be really useful to allow standard ng-options syntax; this seems like a major limitation. |
PR #1208 should resolve this |
Forgive me if this has already been asked, I couldn't find a ticket for it.
I'm migrating from ui-select2, which allowed me to use objects as my data for example:
How can I use an object as my data in ui-select?
I tried
data-repeat="name in data"
but got[ui.select:items] Expected an array but got {"Adam"...
The text was updated successfully, but these errors were encountered: