-
Notifications
You must be signed in to change notification settings - Fork 27.4k
[filter] allow object maps along with arrays #2694
Comments
+1 |
+1 |
+1 $scope.objectToArray = function(item) { |
+1 |
+1 Also wondering if this has gone through any progress. |
+1 |
1 similar comment
+1 |
+1 |
Given that cea8e75 landed, I don't think it is going to happen. Closing as "won't fix". |
@pkozlowski-opensource I think this is a very hasty closing - and I think the other commit should be revised as well. I originally opened this issue because it would be 'immensely useful' if object maps were also allowed in parallel to arrays, not because angular didn't give an error if I tried. I'm sure the +1s in this thread were also made for also the same practical advantage that this feature would give, and not for the lack of error output. I still strongly feel that this feature should be added in the angluar core, and hence this thread reopened. It is disappointing that this has been given such a lack of interest considering almost 2 years has past since the original post. |
@caitp @gkalpak @petebacondarwin what is the final team's decision on this issue? I figured it was "won't fix" since cea8e75 landed. I guess we should decide once and for all if we want to include this in the core and then either:
I'm not sure we should include it in core. Personally I didn't bump into the scenario where this would be need for an elegant solution, but it seems like some people feel strongly about this one. |
it doesn't work well with objects since it is converted to an array, and information is lost. the only way it could conceivably work without losing information, is if each key/value pair were wrapped in an object themselves. This makes everything rather clunky, and is not ideal. Plus, the use cases for actually using an object rather than an array are rather limited. everything from animations to filtering loses some important details of quality when used with an unordered set, and not all of these are fixable in a manner we'd like to ship. so it's unfortunate, but I don't think this is something worth fixing |
I agree
|
The current implementation of filter only allows arrays. It would be nice if we could also use filter with object maps. (some 3rd party plugins return object maps instead of arrays)
I'm having to convert all the object maps I receive to arrays each time just so that I can get the filtering to work.
example found:
http://stackoverflow.com/questions/13887504/filtering-on-object-map-rather-than-array-in-angularjs
The text was updated successfully, but these errors were encountered: