pagination
| // Pagination | |
| $scope.currentPage = 1; | |
| $scope.numPerPage = 10; | |
| $scope.maxSize = 5; | |
| $scope.paginate = function (value) { | |
| var begin, end, index; | |
| begin = ($scope.currentPage - 1) * $scope.numPerPage; | |
| end = begin + $scope.numPerPage; | |
| index = $scope.items.indexOf(value); | |
| return (begin <= index && index < end); | |
| }; |
| <table> | |
| <thead><tr><th>#</th><th>Document Name</th></tr></thead> | |
| <tbody> | |
| <tr data-ng-repeat="di in documentItems | filter : paginate"> | |
| <td>{[{$index+1}]}</td> | |
| <td>{[{di.name || '---'}]}</td> | |
| </tr> | |
| </tbody> | |
| </table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment