Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <uib-pagination total-items="totalCount" ng-model="currentPage" ng-change="pageChanged()" items-per-page="2"></uib-pagination>
- $scope.currentPage = $location.search().page;
- getData($scope.currentPage);
- $scope.pageChanged = function () {
- getData($scope.currentPage);
- $location.url('?page=' + $scope.currentPage);
- };
- function getData(pageNumber) {
- if (pageNumber == null)
- pageNumber = 1;
- $http.get('http://localhost.angulartestapi.com/v1/AngularTestApi/getteams?pageNumber=' + pageNumber)
- .success(function (data) {
- $scope.teams = data.Teams;
- $scope.totalCount = data.TotalCount;
- }).error(function () {
- alert("error");
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement