I recently followed a tutorial on creating pagination and found it very helpful. The tutorial I used can be found at https://github.com/feichao/angular-material-paging
To test out the pagination functionality, I added a json data called myData with some items. However, as a junior programmer, I encountered an issue with the gotoPage() function.
Here is the snippet of code where I made changes:
ctrl.total = ctrl.myData.length;
ctrl.currentPage = 1;
ctrl.step = 6;
ctrl.gotoPage = function() {
if(ctrl.total) {
for(var i=0; i < ctrl.total; i++) {
//
}
}
};
My problem now is figuring out how to modify the code within the gotoPage() function so that only 10 items from my json data are displayed per page. For reference, you can check out the demo showcasing these properties and methods.
If anyone has any suggestions or ideas on how to achieve this, I would greatly appreciate the help!