Q:

Custom filter in AngularJS after adding pagination

After implementing the pagination to my ng-repeat listing (Update pagination in AngularJS after filtering)
<li ng-repeat="data in filtered = (list | filter:search) ... >

I now have a problem with my custom filter
<li ng-repeat="data in filtered = (list | filter:search) | customFilter:search ... >

I need this filter to search by multiple languages (select two or more languages).
If I you replace data in filtered = (list | filter:search) with data in list, you will see it's working. But I need filtered for my pagination.
jsFiddle: http://jsfiddle.net/StinsonMaster/SuEX6/4/ (based on the fiddle from the previous thread)

A:

I think I misunderstood your original question.
I rewrote your custom filter. It's not exactly objected oriented, but with a little touching up it could be much more extensible. Basically you just needed something that was more inclusive than the base angular filter.
app.filter("customFilter", function() {
    return function(input, search) {
        if(search && search != undefined) {
            var _toRet = new Array();
            for(var i in search) {
                for(var k in input) {
                    if(search.indexOf(input[k].language) != -1 && _toRet.indexOf(input[k]) == -1) {
                        _toRet.push(input[k]);
                    }
                }
            }
            return _toRet;
        } else {
            return input;
        }
    };
});

Also please note the changes to your ngRepeat syntax.
ng-repeat="data in filtered = list | filter:search.name | customFilter:search.language | startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit"

http://jsfiddle.net/doublekid/5Bs3h/

