如何使用ngInfiniteScrol?

时间:2017-04-10 12:58:20

标签: javascript angularjs nginfinitescroll

我在角js中使用ngInfiniteScrol我的js函数是

var value = row.Field<string>("FREQ");

//If you sure that value is only one character long
var character = value != null ? value[0] : '';

我的html文件是

$scope.busy = false;
    $scope.nextPage = function() {
         if ($scope.busy) return;
        var checkLast = $("#endlistings").val();
        var off_set = $("#offSet").val();
        var offsetCounter = parseInt($("#offSetCounter").val()) - parseInt(10);
        newrec = parseInt(off_set) + 10;
        if (off_set >= 10 ){
            $scope.busy = true;
            console.log("if");
            var url = CONFIG.APIURL + "Deployed_pets/getDeployedPetsResults/" + off_set + "/" + offsetCounter;
            $http.get(url).success(function(data) {
               angular.extend($scope.deployed_pets, data.deployed_pets);
               $("#offSet").val(newrec);
              $scope.busy = false;
            });
        }
    };

第一次向下滚动后它可以正常工作但是在我第一次向下滚动它继续加载数据

0 个答案:

没有答案