希望做到每点击一次加载按钮,就请求一次数据,数据加在上次的数据之上,实现下拉加载,应该怎么做?//数据循环列表<ul class="mui-table-view news-list"> <li ng-repeat="item in items"> <a href="news-detail.html"> <h3 ng-bind="item.title"></h3> </a> </li> <button ng-click="loadPage()" type="button">加载</button></ul>//发起请求var page = 0;function loadPage(){ var url=domain+'/school/opinion/list?currentPage='+page+"&deviceType=WECHAT"; $http.get(url,{},{'Content-Type':'application/x-www-form-urlencoded'}).then(function successCallback(response) { $scope.items = response.data.data; }, function errorCallback(response) { console.log(response.code) }); page++; }
1 回答

慕无忌1623718
TA贡献1744条经验 获得超4个赞
获取新的数据后concat到后面
$scope.items = $scope.items.concat(response.data.data);
添加回答
举报
0/150
提交
取消