Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 尝试使用angular js进行无限滚动_Javascript_Angularjs_Infinite Scroll - Fatal编程技术网

Javascript 尝试使用angular js进行无限滚动

Javascript 尝试使用angular js进行无限滚动,javascript,angularjs,infinite-scroll,Javascript,Angularjs,Infinite Scroll,我尝试使用angular js实现无限滚动 app.controller('cardCtrl', function ($scope, $http,$window,$location) { var isNext = true; var next; $scope.init=function(authtoken,cityname){ $scope.authtoken=authtoken; $scope.cityna

我尝试使用angular js实现无限滚动

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;                                  
        });             
    };

现在这个无限滚动运行良好。我只面临一个问题:如何将每个api数据存储在$scope.deal中(每个api都是相同的结构)

yu检查过ui滚动吗?停止构建你正在做的事情,并使用它最基本的功能“当元素变得不可见时销毁它们,当它们再次可见时重新创建它们。”-避免创建观察者,让你的应用程序变得迟钝