Currently, I am implementing pagination in my Angular application by using a custom startAtIndex
filter along with the limitTo
filter. My goal is to show the total number of results in the dataset, regardless of the current page. However, due to the use of limitTo
, the array is cut off at that point, making it difficult to retrieve the length property.
This is how my ngRepeat
looks:
ng-repeat-start="colleague in pagination.filteredData = (colleagueDataArray | filter:{name: queries.name} | filter:{client: queries.client} | filter:queries.generalQuery | orderBy:sortByField:reverseSort | startFrom: pagination.startAtIndex | limitTo:pagination.pageSize)">
By assigning the filtered results to the pagination.filteredData
object, I can then access its length within the controller using
{{pagination.filteredData.length}}
.
I am wondering if there is a way to determine the length of the filtered array before applying the startAtIndex
and limitBy
filters. Is it possible to partially filter the colleagueDataArray
array, and then apply additional filtering within the ngRepeat
?
If this explanation is unclear, please let me know so I can provide further clarification.