UI Bootstrap pagination in Angular Project

Posted By : Vipul Pandey | 26-Sep-2016

UIB Pagination is lightweight pagination directive that helps us to paginate our web project. To use Angular UI bootstrap pagination we can get the code form here https://angular-ui.github.io/bootstrap/ and can use in our project.

To use we have HTML snippet to add in our project.

 


       

 

 

angular.module('myModule', ['ui.bootstrap']);
     .controller('myCtrl', ['$scope',    function ($scope) {
         $scope.maxSize = 5;
         $scope.currentPage = 1;
         $scope.totalPages = 20;

       $scope.pageChanged = function () {
            // operation to perform on page changed
            console.log("Hi I am on ",($scope.currentPage-1),"page")
        };
  }])

 

  1. The maxSize is number page navigator on a page.
  2. The currentPage is active page in HTML specified by ng-model.
  3. The totalPages is number of all the pages.
  4. boundary-links  is used to display. First and last page button and by default it is false.
  5. ng-change call the operation on page change event.

THANKS

About Author

Author Image
Vipul Pandey

Vipul Pandey is a good team-player & developing application on MEAN and java spring boot. Vipul loves to keep rotating fingers in his keyboard until he creates somethings inspiring.Hobbies are playing cricket ,swimming & photography.

Request for Proposal

Name is required

Comment is required

Sending message..