这是我的代码:
按钮:
<li ><a data-ng-click="Data1 = true;Data2 = false; search.status = ''" href="">ALL PROJECTS</a></li>
<li ><a data-ng-click="Data2 = true;Data1 = false" href="">NOTIFICATIONS</a></li>
点击按钮时填充的数据:
<ul>
<li ng-show="Data1" dir-paginate="wd in workOrdersList | filter: search.status | filter: search.name | itemsPerPage: 10">
<a href="">
<h4>{{wd.name}}</h4>
</a>
<p>Status: {{wd.status}}</p>
</li>
<li ng-show="Data2">
<div ng-show="!notificationDataDashord.length">
<span>No Notifications</span>
</div>
</li>
</ul>
<dir-pagination-controls auto-hide="true"></dir-pagination-controls>
控制器内部:
$scope.Data1 = true;
$scope.Data2 = false;
我正在使用此链接中的分页指令:
https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination
答案 0 :(得分:1)
dirpagination的一个问题是它在你再次加载数据后没有更新集合。
见
https://github.com/michaelbromley/angularUtils/issues/208
https://github.com/michaelbromley/angularUtils/issues/137
明显的解决方法
<dir-pagination-controls ng-show="Data1" auto-hide="true"></dir-pagination-controls>