I followed the http://bazalt-cms.com/ example for pagination, but using a $http.getvariable in the controller instead of hard coding.
$http.get("data.json").success(function(data){
$scope.dataset = data;
}
I also moved $scope.tableParamsinside$http.get
$http.get("data.json").success(function(data){
$scope.dataset = data;
$scope.tableParams = new ngTableParams({
...
}
});
and changed the variable datato$scope.dataset
total: $scope.dataset.length,
getData: function($defer, params) {
$defer.resolve($scope.dataset.slice((params.page() - 1) * params.count(), params.page() * params.count()));}
Everything works fine, except that the page does not work. See here Plnkr
source
share