1.0.5 • Published 10 years ago

angular-simple-pagination v1.0.5

Weekly downloads
5
License
MIT
Repository
github
Last release
10 years ago

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