Simple pagination directive for AngularJS. It's tested against angular 1.4.8.
npm install angular-simple-pagination
Module:
angular.module('YOUR_MODULE', ['angularSimplePagination']);
Controller:
angular.module('YOUR_MODULE').controller(function($scope) {
$scope.settings = {
currentPage: 0,
offset: 0,
pageLimit: 5,
pageLimits: ['10', '50', '100']
};
$scope.items = [...];
$scope.callback = function() { ... };
});
HTML:
<simple-pagination
current-page="settings.currentPage"
offset="settings.offset"
page-limit="settings.pageLimit"
page-limits="settings.pageLimits"
on-update="callback()"
total="items.length">
</simple-pagination>
<div ng-repeat="item in (items | limitTo:settings.pageLimit:settings.offset)">
...
</div>
gulp build
gulp test