Short and sweet. Implemented smart-table on a new project, and needed to customize the pagination template. This is simply an override of the default found in smart-table.js

ng.module('smart-table', []).run(['$templateCache', function ($templateCache) {
 '<nav ng-if="numPages && pages.length >= 2"><ul class="pagination">' +
 '<li ng-class=""><a ng-click="selectPage(1)">First</a></li>' +
 '<li ng-class=""><a ng-click="selectPage(currentPage-1)"><i class="fa fa-fw fa-angle-double-left"></i></a></li>' +
 '<li ng-repeat="page in pages" ng-class="{active: page==currentPage}"><a ng-click="selectPage(page)">{{page}}</a></li>' +
 '<li ng-class=""><a ng-click="selectPage(currentPage+1)"><i class="fa fa-fw fa-angle-double-right"></i></a></li>' +
 '<li ng-class=""><a ng-click="selectPage(numPages)">Last</a></li>' +
Categories: Random


Scott · July 5, 2016 at 5:58 pm

This was great. Thanks!

Ezequiel · February 26, 2018 at 9:38 am

Worked fine. Thanks!

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *