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