我尝试使用角度js .my代码
制作无限滚动app.controller('cardCtrl', function ($scope, $http,$window,$location) {
var isNext = true;
var next;
$scope.init=function(authtoken,cityname){
$scope.authtoken=authtoken;
$scope.cityname=cityname;
if(isNext) {
next = '/api/v1/asasa?city='+$scope.cityname+'&auth='+$scope.authtoken;
isNext = false;
}
next = next.replace('localhost:8030','');
$http({method: 'GET', url: next}).success(function(data) {
$scope.card = data.aggregations;
$scope.deal = data.deals;
next = data.next;
});
};
现在这个无限滚动工作正常。我只是面对一个问题我如何在$ scope.deal中保存每个api数据(每个api相同的结构)