Ok I have a ng-repeat:
<div id="scrolltwo" class="animate-repeat panel" ng-repeat="items in arrayfull |filter:filtertype ">
and in filtertype i have:
[[0] => "Typeone", [1] => "Typetwo" ]
how do i get the filter to iterate across the whole array and match results that match the values?
UPDATE with custom filter:
<div id="scrolltwo" class="animate-repeat panel" ng-repeat="items in arrayfull | array | filter:matchaccnttypes(accnttypes)">
Array filter which works:
.filter('array', function() {
return function(items) {
console.log(items);
var filtered = [];
angular.forEach(items, function(item) {
filtered.push(item);
});
return filtered;
};
})
matchaccountypes which doesn't!:
$scope.matchaccnttypes = function matchaccnttypes(query) {
return function(items) {
return items.Organtype.match(query);
angular.forEach($scope.accnttypes, function(value, key){
console.log(key + ': ' + value);
});
}
};
it just returns the last value passed into the $scope.accntypes array which is my sample array above..