I use the ng-table plugin to split the table as follows:
$scope.ngtableParams = new ngTableParams({}, { counts:false, getData: function(params) { return $http.get($rootScope.app.authApi + 'questions/' + selectedSubtopic.id).then(function(data) { params.total(data.data.length); return data.data; }); } });
Funnily ng-table calls the getData () function every time a user clicks on page numbers. And again it hits everything, extracts all the records and displays them. Thus pagination is practically useless.
I need to have a pagination client. Is this possible with ng-table?
Tried it also
$http.get($rootScope.app.authApi + 'questions/' + selectedSubtopic.id) .success(function(data){ $scope.ngtableParams = new ngTableParams({count:5}, { counts:[], paginationMaxBlocks: 13, paginationMinBlocks: 2, total:data.length, getData: function(params) { return data; } }); });
The same with the above!
angularjs pagination ngtable
beNerd
source share