0
我有以下的JSON:AngularJS +分页+引导
http://localhost:3001/images?page=1
{"images":[{"_id":"542e57a709d2d60000c93953","name":"image1","url":"http://www.syll.com","__v":0},{"_id":"542e58e19d237e5b790f4db2","name":"image154","url":"www.rufyge.com"},{"_id":"542e58e19d237e5b790f4db3","name":"image45784","url":"http://www.test.com"},{"_id":"542eb5bbe26bca641c676ec9","name":"image1","url":"http://www.syll.com","__v":0},{"_id":"542eff1197896530323371b2","name":"image1","url":"http://www.syll.com","__v":0},{"_id":"542f0514b96a17781a5de9ef","name":"image1","url":"http://www.syll.com","__v":0},{"_id":"542f0b618101e35037651a7b","name":"image1","url":"http://www.syll.com","__v":0},{"_id":"543247b7d78ae2dc6a73c4eb","name":"image1","url":"http://www.syll.com","__v":0},{"_id":"543249050fcae2f082ca3e70","name":"imageOCR1","url_image":"http://meta-e.aib.uni-linz.ac.at/ocr/images/biographie_ocr.gif","__v":0},{"_id":"543249050fcae2f082ca3e71","name":"imageOCR2","url_image":"http://www.textcreationpartnership.org/files/2012/02/ocr.jpg","__v":0}],"pageCount":7,"itemCount":66}
有:
"pageCount":7,"itemCount":66
然后也:
http://localhost:3001/images?page=2
http://localhost:3001/images?page=3
http://localhost:3001/images?page=4
...
我要找用Boostrap做分页(上一页/下一页)和AngularJS。
我做:
<div ng-repeat="product in filteredId = (products | filter:search)">
<h3><a style="cursor: pointer;" ng-click="products.chosen = product">{{product.name}}</a></h3>
</div>
与我的控制器:
function imageController($scope, $http){
$scope.showCompanies = function(){
$http.get('http://localhost:3000/images')
.success(function(response){
$scope.products = response;
console.log(response); })
.error(function(response){ alert('Une erreur est survenue'); console.log(response); });
}
$scope.showCompanies();
}
但是没有分页。
任何想法如何迭代所有的JSON并有一个Next/Prev按钮来获取?
感谢您的帮助!
你应该使用'smartTable' [执行功能看到文档](http://lorenzofox3.github.io/smart-table-website/) – Saqueib 2015-01-30 09:15:02
你使用angular.js bootstrap? – 2015-08-12 10:28:18