ionic之上拉載入更多

2021-07-16 09:08:45 字數 1112 閱讀 7776

controller**

.controller('articlepagectrl', ['$scope', '$stateparams', '$ionicslideboxdelegate', 'financlist', '$timeout', function

($scope, $stateparams, $ionicslideboxdelegate, financlist, $timeout) ,

];//上拉載入更多

financlist.param.hasmore = true;

//上拉觸發函式

$scope.loadmore = function

() $scope.articles.push(financlist.getlist())

$scope.$broadcast('scroll.infinitescrollcomplete');

financlist.param.curpage++;

}, 1500);

};//控制列表是否允許其載入更多

$scope.moredatacanbeloaded = function

() })

html**

在ion-content標籤內增加下面的**,很多童鞋上拉重新整理實現不了,就是因為這段**沒有加到content標籤內,因為只有在標籤內的元素,才會有scroll的效果。

icon="ion-loading-c"

ng-if="moredatacanbeloaded()"

on-infinite="loadmore()"

distance="10%">

ion-infinite-scroll>

service**

.factory('financlist', function

() ;

//頁碼

param.curpage = 1;

param.hasmore = false;

function

getlist

() ;

}return ;

})

ionic 上拉載入更多詳細步驟

1.必須寫在content標籤裡面 2.controller裡面 controller custsrvsearchctrl scope stateparams timeout custsrvservice ionichistory state ionicloading function scope,...

ionic 下拉重新整理和上拉載入更多

1.on refresh 下拉觸發的函式 函式執行結束之前必須廣播下該事件結束 scope.broadcast scroll.refreshcomplete 2.on infinite 上拉觸發的函式 同樣需要廣播事件結束 scope.broadcast scroll.infinitescrollc...

ionic 實現下拉重新整理上拉載入更多

網上例子太多了,官網的文件也很全,不過在這裡闡述下,方便自己查詢,官網速度太慢了,估計是自己網速原因了,小公司傷不起啊。下拉重新整理上拉載入更多,直接來 裡都有說明 view title 活動頁 class padding pulling text 下拉重新整理 on refresh vm.dore...