michaelbromley/angularUtils-pagination — pull request #2 by geoffwa (2014-10-03 21:51:57+00:00)
Title: allow pagination-id to be retrieved from $scope

Hi!

First up - thanks for making this angular code available! I've been using it in a couple of projects at work.

One modification - with the way the itemsPerPage filter is set up at the moment you're forced to use a completely static pagination id, even though the pagination-id attribute that is passed to the dirPaginate element and the dirPaginate controls is expanded as an angular expression.

I've made a slight tweak that allows for itemsPerPage to also be passed in as an attribute, and if this is case create an itemsPerPage filter in the link method if none is provided. This is useful if I'm constructing a bunch of dirPaginated tables in an ng-repeat loop and I need a dynamically generated paginationId.

There's a link to plunker in the README of an example of this.

Let me know if there's anything you need.