1.0.5 • Published 7 years ago

mv-paginator v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

mv.paginator

Angular plugin for easy paginate any element.

DEMO using www.jsonplaceholder.com requests: https://jsfiddle.net/alphonse92/x528jk9f/

##Instalation:

Using NPM:

  npm install mv-paginator

###Using BOWER:

  bower install mv-paginator

##HTML impl

The innerHTML especifies the template, basically the plugin add a ng-repeat to the first element. $paginator_item is the item's array, and name is the property for this object.

  <paginator pagedata="pagedata">
       <div>{{$paginator_item.name}}</div>
  </paginator>

##config

.config(['paginatorProvider',function(paginatorProvider){
                paginatorProvider.setConfig({
                    lengthDefault:5, /* five elements per page*/
                    labelBefore:"<",
                    labelNext:">",
                    labelFirst:"<<",
                    labelLast:">>"
                })
        }])

##Controller

angular.module('app', ['com.alphonsegs.paginator'])
        .config(['paginatorProvider',function(paginatorProvider){
                paginatorProvider.setConfig({
                    lengthDefault:5,
                    labelBefore:"<",
                    labelNext:">",
                    labelFirst:"<<",
                    labelLast:">>"
                })
        }])
        .controller("mainController", function ($scope) {
            $scope.pagedata = [];
            $scope.loadata = function () {

                for (var i = 0; i < 500; i++)
                {
                    $scope.pagedata.push({name: "alejandro-" + i})
                }
            }
            $scope.loadata();
        })

Preview

alt tag

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago