The first article, do not know what to write, reasoning, to the page control using methods, hope to discuss together.
Paging is a common function of the front-end data display, and in our use of angular JS, the original paging needs to take all the data to the front end, and then to the front page paging, in large-scale data operation is not practical. Next, I'll show you how to modify a jquery paging control to a ANGULARJS instruction.
The jquery1.10, Angularjs library files, and jq-pagination controls are referenced first in the Web project.
I drop the instruction name custompagination and add the HTML style to the directive.
Then add the corresponding controller to the instruction.
When the instruction is used, the HTML page code is as follows
The corresponding controller data acquisition method is
The end-use effect of the control.
Note: The invocation of the jquery control is more of a synchronous approach, while the angularjs gets the background data is all asynchronous, while using both jquery and angularjs need to be careful to combine the two different programming ideas. The biggest problem in this example is how to notify the jquery paging control of a new paging condition after using ANGULARJS to get background data, and then refresh the page data for the paging control. This example is done in the Angularjs and jquery code with each callback. In fact, you can also use watch in the ANGULARJS directive to monitor the paging control data changes to achieve the purpose of refreshing the page, you are welcome to further explore.
Using jquery paging controls in Angularjs