﻿//{"page":"1","pagesize":"20","total":"13","records":"242","rows":[{}]}

var app = angular.module('app', []);
app.controller('pagelist-ctrl', function ($scope, $http) {
    $scope.nextpage = function (page) {
        $http.get("/api/productsforstaff?rows=9&page=" + (page || 1)).success(function (data) {
            $scope.page = data;
            $scope.totalPages = parseInt(data.total);
            $scope.currentPage = parseInt(data.page);
        });
    }
    $scope.nextpage();
    $scope.pageCallback = function (page) {
        $scope.nextpage(page);
    };
});
