You do not see the pagination buttons, because your get () probably returns 10 for counting due to the server-side "rangeStart", "rangeStop" constraint, and if you return 10 results out of 10, then nothing needs to be broken to the pages.
You can return 10 results per query, but params.total should always be a count of all results.
In any case, you do not need 2 get () calls when you can return them something like this: D
{ "results": [ { "id": "1437", "task_started_at": "2014-06-09 12:25:25", "task_finished_at": "2014-06-09 12:25:25" }, { "id": "1436", "task_started_at": "2014-06-09 12:26:31", "task_finished_at": "2014-06-09 12:26:31" } ], "total": 1027 }
And you can look like this:
params.total(data.total); $defer.resolve(data.results);
And also you do not need the total, because you get it from seerver so remove:
total: 0;
The final code with two calls to get () might look something like this:
this.tableParams = new ngTableParams({ page: 1, count: 10 }, { getData: function($defer, params) { $http.get('/app/api/period', {params: { pageNumber:params.page() - 1, rangeStart:rangeStart, rangeStop:rangeStop}}) .success(function(data, status) { params.total($http.get('/app/api/period/count')); $defer.resolve(data); }); } });
where $http.get('/app/api/period/count') returns the total number of entries, such as 1234
Good luck.