Skip to content

Instantly share code, notes, and snippets.

@cguldogan
Created November 8, 2017 17:58
Show Gist options
  • Save cguldogan/3660c35fe2cb2a25da2872a7dfcb3430 to your computer and use it in GitHub Desktop.
Save cguldogan/3660c35fe2cb2a25da2872a7dfcb3430 to your computer and use it in GitHub Desktop.
Angularjs Table Paging
//Use : http://angular-ui.github.io/bootstrap/
HTML PART
---
....
</table>
<pagination
ng-click="ctrl.showPageUkOnly()"
ng-model="ctrl.currentPageUkOnly"
total-items="ctrl.ukOnlyResults.length"
max-size="ctrl.maxSize"
boundary-links="true">
</pagination>
JS PART
----
vm.currentPageUkOnly = 1;
vm.numPerPageUkOnly = 10;
vm.filteredUkOnlySubmissions = [];
function showPageUkOnly(){
var begin = ((vm.currentPageUkOnly - 1) * vm.numPerPageUkOnly);
var end = begin + vm.numPerPageUkOnly;
vm.filteredUkOnlySubmissions = vm.ukOnlyResults.slice(begin, end);
console.log('vm.filteredUkOnlySubmissions:',vm.filteredUkOnlySubmissions);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment