Click here to Skip to main content
15,910,471 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,
i have a list which is shown in
ng-repeat
. Now above list got filtered run time based on search condition.

Now i needs to find no of current records after filter in controller.

<tr class="itemclass" ng-repeat="x in JobList | filter:search |pagination : currentPage*itemsPerPage | limitTo: itemsPerPage | filter: dateRangeFilter('startDate', startDate, endDate)">


Please help me on this.

What I have tried:

Count of
JobList 
allways give total no of record at intial level not run time.
Posted
Updated 13-Mar-17 19:53pm

1 solution

 
Share this answer
 
Comments
Mukesh Ghosh 14-Mar-17 2:22am    
Thanks for above solution.
I can have count filtered record. But while try to find in controller like
$scope.results.length it gives as undefined.

Am i missing anything?
Karthik_Mahalingam 14-Mar-17 2:23am    
so you need the filtered count in controller?
Mukesh Ghosh 14-Mar-17 2:25am    
Yes. I need to do some caluction based on that. Thanks
Karthik_Mahalingam 14-Mar-17 2:37am    
check this
https://jsfiddle.net/karthikjsf/j6xvyxxu/1/
Mukesh Ghosh 14-Mar-17 3:28am    
Issue with some pagination. As i am showing 5 record per page. So on page load before filtering JobList should show bw equal as filtered results but in this case JobList count show 10 whereas filtered results shows 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900