【发布时间】:2015-12-08 19:54:06
【问题描述】:
编辑!
添加了更多代码 sn-ps 和 plunker 更新(再次)
对于 Angular 和一般的编码来说还是很新的。
我已经尝试并尝试从Angular Directives 网站实例化 UI 分页。我搜索了 Stack Overflow 和 codeProject 以及其他各种网站。我一辈子都无法让我的分页工作。
我不知道还能尝试什么。我很确定我已经调用了足够多的属性
<uib-pagination
items-per-page="itemsPerPage"
ng-model="currentPage"
max-size="maxSize"
class="pagination-sm"
next-text="»"
previous-text="«"
boundary-links="false" >
</uib-pagination>
并运行控制器:
app.controller('PaginationControl',function ($scope, $window) {
// Pagination variables
$scope.totalItems = 100; //this needs to be changed to represent the total of filtered parks after a search is done and NOT a static number.
$scope.currentPage = 1;
$scope.maxSize = 8;
$scope.itemsPerPage = 10;
});
我不明白的是如何根据我的搜索结果将分页属性从控制器中硬编码的静态数字更改为动态数字。
这是一个 Plunker,除了分页功能之外,它什么都可以工作。
非常感谢
【问题讨论】:
标签: jquery angularjs pagination angular-ui-bootstrap