Skip to content

dirPagination v0.11.0 - Pagination Semi-Broken #325

@DougHayward

Description

@DougHayward

Hi, I have recently implemented dirPagination into my project. I'm attempting to iterate over a JSON Object which work's to a point.

On initial page load the Pagination works great. However if I navigate away from the page but then return the pagination breaks with an error of:

pagination directive: the itemsPerPage id argument (id: __default) does not match a registered pagination-id.
Error: instances[instanceId] is undefined

I currently implement it as per the documentation with:

<!-- View File  (Simplified) -->
<div ui-view ng-init="getData()">
   <tr dir-paginate="data in datas| toArray:false | filter:query | orderBy: sortKey:reverse | itemsPerPage:5">
   </tr>
    <dir-pagination-controls
    max-size="5"
    direction-links="true"
    boundary-links="true" >
   </dir-pagination-controls>
</div>

<!-- Controller (Simplified) -->
$scope.getData = function () {
    DataSender.get('Data').then(function (data) {
        if (data) {
            $scope.datas = data;
        }
    });
};

The data still gets loaded however the pagination buttons do nothing except error into the console. It also breaks filtering, though I think this is just a knock on effect. If I replace dir-paginate with ng-repeat it works when navigating between pages but obviously without the pagination ability.

I'm using Angular v1.5.1 and dirPagination v0.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions