3

is there any good example of server side pagination using ngTable and ngResource.

i am loading a table like this

    function getStoreCommands() {
        $scope.data = storeCommandResource.query();

        return $scope.data.$promise.then(function (response) {
            $scope.data = response;
            $scope.$watch("data.query", function () {
                $scope.storeCommandsTableParams.reload();
            });
            $scope.storeCommandsTableParams = new ngTableParams({
                page: 1,            // show first page
                count: 10,          // count per page

and so on .............................................................

where storeCommandResource uses ngResource. i want to load only first 10 records as per my ngTableParams and when someone clicks another page it should load data of that page from the server.

i have classic Web Api REST functions with oData enabled on server side to support ngResource.

kindly help.

Raas Masood
  • 1,475
  • 3
  • 23
  • 61

0 Answers0