为什么无限卷轴不起作用?它似乎是负载条,但不会对其他元素充电。这是我第一次参加离子实验室而且我不太了解这门语言。
$scope.loadMore = function() {
var page = 2;
$http.get("endpoint where I canfound the data" + page).success(function(data, status) {
page = page + 1;
mergeArrays($scope.corsi, data);
$ionicScrollDelegate.resize()
$scope.$broadcast("scroll.infiniteScrollComplete");
}).
error(function(data, status) {
// log error
alert('error lettura corsi');
});
};
html页面:
<ion-content>
<div ng-controller="MyCtrl">
<ion-list>
<ion-item ng-repeat="corso in corsi">
<a class="item item-thumbnail-left" ng-click="sceltaCorso(corso.course_id)" href="#/app/singleCourse">
<img src={{corso.course_introimage}}>
<h2>{{corso.name}}</h2>
<h4>{{corso.short_description}}</h4>
<h5>{{corso.course_author}}</h5>
</a>
</ion-item>
</ion-list>
<ion-infinite-scroll on-infinite="loadMore()"></ion-infinite-scroll>
</div>
</ion-content>