filter on key/value ng-repeat bug?

Showing 1-14 of 14 messages
filter on key/value ng-repeat bug? ItsLeeOwen 4/11/12 12:02 AM
Is this a bug?  The filter is not being executed when ng-repeating the (key,value) in collection.

Re: [angular.js] filter on key/value ng-repeat bug? Misko Hevery 4/11/12 8:27 AM
not a bug. Filter works on arrays, and you are trying to filter an object. You need to write your own objectPropertyFilter for that which would iterate over properties and the return an array.

On Wed, Apr 11, 2012 at 12:02 AM, ItsLeeOwen <l...@coderebelbase.com> wrote:
Is this a bug?  The filter is not being executed when ng-repeating the (key,value) in collection.

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/bUlU-piCqF0J.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.

Re: [angular.js] filter on key/value ng-repeat bug? Pete Bacon Darwin 4/11/12 8:33 AM
Re: [angular.js] filter on key/value ng-repeat bug? Raj 4/11/12 8:39 AM
This for some reason does not work in IE 9....
Re: [angular.js] filter on key/value ng-repeat bug? ItsLeeOwen 4/11/12 8:59 AM
Ok, thanks Misko.  What is the recommended approach to writing an objectPropertyFilter to work on an ng-repeat?
Re: [angular.js] filter on key/value ng-repeat bug? Misko Hevery 4/11/12 9:04 AM
http://docs-next.angularjs.org/api/angular.module.ng.$filterProvider

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/uZhLyvE5nd8J.

To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.

Re: [angular.js] filter on key/value ng-repeat bug? ItsLeeOwen 4/11/12 9:08 AM
Re: [angular.js] filter on key/value ng-repeat bug? ItsLeeOwen 4/11/12 9:22 AM
Does anyone see what's wrong with this fiddle?
Re: [angular.js] filter on key/value ng-repeat bug? ItsLeeOwen 4/11/12 9:29 AM
The filter works outside of an ng-repeat, but not in the ng-repeat.
Re: [angular.js] filter on key/value ng-repeat bug? ItsLeeOwen 4/11/12 9:59 AM
Ok, nevermind it does work.  I was expecting the input to be the object, but instead it filters the actual keyword; not the object being repeated.  {{object.value}}  is what is passed to the filter input.

Can you pass multiple arguments to a filter?   | myFilter:[arg1, 'arg2'] ?


Re: [angular.js] filter on key/value ng-repeat bug? ItsLeeOwen 4/11/12 10:34 AM
CORRECTION: the custom filter inside of ng-repeat passes the entire associative array as input, not the key/value of each object, or {{ keyword.values }} as I previously misunderstood.

This works:

http://jsfiddle.net/ItsLeeOwen/ZfGx4/


Re: [angular.js] filter on key/value ng-repeat bug? Suller Andras 4/11/12 8:42 PM
On Wed, Apr 11, 2012 at 11:59 PM, ItsLeeOwen <l...@coderebelbase.com> wrote:
> Can you pass multiple arguments to a filter?   | myFilter:[arg1, 'arg2'] ?

I think the syntax is  | myFilter:arg1:'arg2'

Andras

Re: [angular.js] filter on key/value ng-repeat bug? Benny Lichtner 11/6/12 11:50 PM
Is this possible to do without modifying the original object? I don't want my filter to actually destroy my data. I've tried this: http://jsfiddle.net/eNBZW/, but I get a digest iterations error.
Re: [angular.js] filter on key/value ng-repeat bug? Sandip Chitale 3/28/13 11:05 PM
Try adding

angular.module('MyApp', []).filter('removeAdam', function() {
    return function(input) {
        input = angular.copy(input);
        $.each( input, function(k,v)
        {
            if( 'Adam' === v.name ) {
                delete input[k];
            }
        });
        return input;
    }
});

It worked for me.