angular-simple-pagination

1.0.5 • Public • Published

Angular Simple Pagination


GitHub build GitHub tag GitHub license

About

Simple pagination directive for AngularJS. It's tested against angular 1.4.8.

Installation

npm install angular-simple-pagination

Usage

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>

Demos

  1. Simple example

Tasks

gulp build
gulp test

Package Sidebar

Install

npm i angular-simple-pagination

Weekly Downloads

1

Version

1.0.5

License

MIT

Last publish

Collaborators

  • raoulus