Pagination into multiple tables on a single AngularJS page

Hi, I am facing a problem when integrating dir-pagination on multiple tables of the same page, which please offer a solution, dir-pagination works fine for the first table, but for the second table it does not work properly when we switch the page for the first table, the second page of the table also gets a switch.

                    <table>
                        <thead>
                          <tr>
                            <th>_id1</th>   
                            <th>modifiedDate1</th>
                          </tr>
                        </thead>
                        <tbody>
                           <tr dir-paginate = "result in searchResult1 |filter:search |itemsPerPage:5"> 
                            <td>{{result._id}}</td>
                            <td>{{result.modifiedDate | date:"MM-dd-yyyy h:mma"}}</td>
                           </tr>
                        </tbody>
                    </table> 
                    <dir-pagination-controls class="pull-right"
                            max-size="6"
                            direction-links="true"
                            boundary-links="true">
                       </dir-pagination-controls>


                       <table>
                        <thead>
                          <tr>
                            <th>_id2</th>   
                            <th>modifiedDate2</th>
                          </tr>
                        </thead>
                        <tbody>
                           <tr dir-paginate = "row in searchResult2 |filter:search |itemsPerPage:5"> 
                            <td>{{row._id}}</td>
                            <td>{{row.modifiedDate | date:"MM-dd-yyyy h:mma"}}</td>
                           </tr>
                        </tbody>
                    </table> 
                    <dir-pagination-controls class="pull-right"
                            max-size="6"
                            direction-links="true"
                            boundary-links="true">
                       </dir-pagination-controls>
+4
source share
2 answers

This solution has only one page, setting table1 and

Set up table2 and

0
source

</table>

  

-1

Source: https://habr.com/ru/post/1617172/


All Articles