TL; DR: You will need to move the filter limitToto the end:
<div ng-repeat="cat1 in catadata1 | filter: {TopCategoryID : 12} | limitTo:quantity1">
limitTofilter will create a new array with the desired length, then your filter will be applied, consider the following:
var catadata1 = [
{TopCategoryID: 13, ...},
{TopCategoryID: 42, ...},
{TopCategoryID: 12, ...},
...
];
var limitTo = catadata1.slice(0, 1);
var filter = limitTo.filter(matchItem({TopCategoryID : 12}));
Another way to look:
var a = [0, 1, 2];
var b = [0]
var c = []
While:
var a = [0, 1, 2];
var b = [0]
var c = [0]
This is what happens in your code, only with a different filter.
source
share