[英]Infinite scolling with ionic framework
我正在開發一個Android應用程序,我使用一個名為“Ionic Framework”的框架。 這是我的問題我必須制作一個具有無限滾動系統框架“離子無限滾動”的系統。
當我在我的電腦上對Chrome進行測試時,盡管我在頁面上的位置,我仍然無法停止離子無限滾動 。
如何放置代碼以使系統正常工作? 謝謝
調節器
$scope.loadMore = function(){
console.log("LoadMOre");
imageCache.init().then(function() {
BonjourTwitterRepository.populate($scope);
});
$scope.$broadcast('scroll.infiniteScrollComplete');
$scope.$broadcast('scroll.resize');
console.log($scope.tweetsList);
if(false){
console.log("ok");
$scope.noMoreItemsAvailable = true;
}
$scope.currentIndex = $scope.currentIndex + $scope.perPage;
};
知識庫
var populateCollection = function (tweets, $scope) {
collection = new TweetCollection();
console.log($scope.currentIndex);
for (var i = $scope.currentIndex; i < $scope.perPage; i++) {
collection.addTweets(new Tweet(tweets[i], $scope, imageCache));
}
$scope.tweetsList = collection;
};
視圖
<ion-item class="item item-body">
<div class="item item-image">
<img ng-src="{{tweet.media_url}}" src="img/loading1.gif"/>
</div>
<p>
by : <a href="https//twitter.com/{{tweet.getUsername()}}">@{{tweet.getUsername()}}</a>
</p>
</ion-item>
<div class="item tabs tabs-secondary tabs-icon-left">
<p>
<a href="#" class="rating-poll"><i class="icon-thumbs-up"></i></a>
<a href="#" class="rating-poll"><i class="icon-thumbs-down"></i></a>
</p>
<p>
<button ng-click="shareThis('{{tweet.media_url}}')" class="button icon button-clear "><i
class="icon ion-share"></i>Share
</button>
</p>
</div>
</ion-list>
<ion-infinite-scroll></ion-infinite-scroll>
<ion-infinite-scroll
on-infinite="fetchTrucks()"
distance="10%">
</ion-infinite-scroll>
你缺少無限滾動指令的關鍵屬性
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.