javascript - How to load more lists on click in angularJS! as the picture shows!

WBOY
Release: 2016-09-21 14:13:08
Original
1074 people have browsed it

javascript - How to load more lists on click in angularJS! as the picture shows!
javascript - How to load more lists on click in angularJS! as the picture shows!

When I click the load button, I don’t know how to loop through page and pagesize’s ng-repeat to the page!

Reply content:

javascript - How to load more lists on click in angularJS! as the picture shows!
javascript - How to load more lists on click in angularJS! as the picture shows!

When I click the load button, I don’t know how to loop through page and pagesize’s ng-repeat to the page!

You need to use conact to connect the data obtained after clicking to load more. pageIndex current page pageSize page number totalNumber are passed from the background.

`
//The following is written in the callback success of the request backend interface
$scope.data= $scope.data.concat(data.data);

`

Set the default current pageIndex to 1

The length of the pulled data defaults to the number of pages set by pageSize

Click the load button pageindex+1, and then call the interface to get the data

The process is roughly like this

I won’t go into details about the number of pages and some judgments

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!