Rajeev Rajeev - 1 year ago 70
AngularJS Question

add text instead of numbers in pagination, angular-bootstrap

I am using angular-bootstrap for pagination and want to change page number with text like year(eg. 2015, 2014, 2013).
Can we customize angular pagination directive so that achieve that case?

Answer Source

Write your own directive on base of the 'pagination' directive and just modify the getPages function. plnkr

    // Add page number links
    for (var number = startPage; number <= endPage; number++) {
      var text = parseInt(scope.startYear, 10) + (number - 1);
      var page = makePage(number, text, number === currentPage);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download