Open PrashanthShivasubramani opened 4 years ago
The issue was in the ng-repeat directive: | limitTo: query.limit: (query.page - 1) * query.limit
I removed that and now it works!
What doesn't work for pagination with server side binding: ng-repeat="show in marvel.series.data.results | orderBy: query.order | limitTo: query.limit : (query.page -1) * query.limit" What works for pagination with server side binding: ng-repeat="show in marvel.series.data.results | orderBy: query.order" Hope it helps!
Note: Taken exactly from fix by Luis Serrano Raised and fixed by -Luis Serrano - https://github.com/luisnomad Issue details - https://github.com/daniel-nagy/md-data-table/issues/415
Issue: I can show data, and the pagination shows up. When I click on the different pages, the "page" value changes and a request is made to the server with the correct arguments, getting back valid data from the server. However, after the first page, all pages show up empty. I don't see any errors so I have no clue about what the issue is. I haven't found any complete example including a controller and a service that requests data from an external API so I don't have a model to follow.
HTML Code to replicate: `
Controller to replicate: `app.controller('marvelController', ['marvelService', '$scope', function(marvelService, $scope) { 'use strict';
}]);`
Service to replicate: `app.factory('marvelService', ['$resource', function($resource) {
}]);`
Fix: The issue was in the ng-repeat directive:
| limitTo: query.limit: (query.page - 1) * query.limit
I removed that and now it works!
What doesn't work for pagination with server side binding:
ng-repeat="show in marvel.series.data.results | orderBy: query.order | limitTo: query.limit : (query.page -1) * query.limit"
What works for pagination with server side binding:ng-repeat="show in marvel.series.data.results | orderBy: query.order"
Hope it helps!