编辑!
添加了更多的代码片段和柱塞更新(再次)
仍然非常新的角度和编码在一般情况下。
我尝试并尝试从角指令网站实例化UI分页。我已经搜索过Stack溢出和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;});
我不明白的是如何根据我的搜索结果将分页属性从硬编码的静态数字更改为动态数字。
这是一个柱塞,除了分页之外,它什么都有。
感激不尽
发布于 2015-12-11 13:13:05
你的扣球有几个问题。您引用的是bootstrap.js文件而不是bootstrap.css文件。您引用了1.4.5版的角核心库和1.4.7版的角动画库。您引用的是jQueryUI,而不是jQuery。您没有在分页指令上设置“总项”属性。下面是一个更新的扑通,其中显示分页。更新的参考块:
<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script src="https://code.angularjs.org/1.4.7/angular-animate.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.8/angular-filter.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.14.3/ui-bootstrap-tpls.min.js"></script>
<script src="script.js"></script> https://stackoverflow.com/questions/34164829
复制相似问题