Rails will_paginate gem with angular.js to do pagination

我与影子孤独终老i 提交于 2019-12-07 08:47:28

I created a directive for this, which might be helpful:

https://github.com/heavysixer/angular-will-paginate

You can use a counter for the number of pages that gets incremented each time your controller gets called.

var counter = 1;

$scope.loadPage = function() {
$scope.entries = Entry.query({page: counter})   
counter += 1 ;    
}

And have a button that refer to that next page.

<button ng-click="loadPage()">Next page</button>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!