尝试使用angularjs进行无限滚动

时间:2014-09-26 09:26:32

标签: javascript angularjs infinite-scroll

我尝试使用角度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相同的结构)

0 个答案:

没有答案