0
如何在等待新闻饲料加载到离子模式时显示微调器?在加载新饲料时显示微调器
.controller('feedsctrl',['$scope','$http',function($scope,$http){
$http.get('http://example.com/feeds.php').success(function(data){
$scope.feeds=console.log(data) ;
$scope.feeds=data;
$scope.numberOfItemsToDisplay = 5; // Use it with limit to in ng-repeat
$scope.addMoreItem = function(done) {
if ($scope.feeds.length > $scope.numberOfItemsToDisplay)
$scope.numberOfItemsToDisplay += 5; // load number of more items
$scope.$broadcast('scroll.infiniteScrollComplete')
}
HTML
<ion-infinite-scroll on-infinite="addMoreItem()" distance="1%"
ng-if="feeds.length > numberOfItemsToDisplay">
</ion-infinite-scroll>
您可以隐藏供稿视图并显示包含加载屏幕的div,直到您的请求的回调完成,然后再次显示供稿视图隐藏加载屏幕中的回调完成部分代码。 –