<div >
<div infinite-scroll='loadMore()' infinite-scroll-distance='2'>
<img ng-repeat='image in images' ng-src='http://placehold.it/225x250&text={{image}}'>
</div>
$scope.images = [1, 2, 3, 4, 5, 6, 7, 8];
$scope.loadMore = function () {
console.log('scroll');
var last = $scope.images[$scope.images.length - 1];
for (var i = 1; i <= 30; i++) {
$scope.images.push(last + i);
}
};
loadMore 函数只在我进入页面时开始调用,向下滚动后不再调用该方法,这是为什么呢?