angularjsdirpagination

The itemsPerPage id argument does not match a registered pagination-id


I'm using pagination in angular js.

<li dir-paginate="meal in meals | filter:q | itemsPerPage: pageSize" current-page="currentPage" pagination-id="mealsPagination">{{ meal }}</li>

however there it show no data and errors in console: pagination directive: the itemsPerPage id argument (id: __default) does not match a registered pagination-id.

Any finding for this issue?


Solution

  • I just noticed that I'm using angularjs version 2 above,thus i need to add the pagination id at after itemsPerPage as

    <li dir-paginate="meal in meals | filter:q | itemsPerPage: pageSize: 'mealsPagination'" current-page="currentPage" pagination-id="mealsPagination">{{ meal }}</li>
    

    This will work!!