According to the accepted answer to this question, if I want to display the length of filtered ng-repeat data I would do:
<div ng-repeat="person in filtered = (data | filter: query)">
</div>
Display the number of results:
Showing {{filtered.length}} Persons
My question is, how would I display the length of the data with that simple query filter when I am also using a limitTo filter:
<div ng-repeat="person in data | filter: query | limitTo: itemsPerPage">
</div>
To be clear, if there are 100 items resulting from data | filter: query
and itemsPerPage = 10
, then in my case I want filtered.length
to be 100, instead of the 10 I get from doing:
<div ng-repeat="person in filtered = (data | filter: query) | limitTo: itemsPerPage">
</div>
Is there a way to get the length of the filtered results from an earlier filtering in the chain, while still applying more filters down the chain that potentially affect the length of the filtered results?