Created
October 9, 2014 14:21
-
-
Save epappas/e8ab580d932aff17f62d to your computer and use it in GitHub Desktop.
Angular Pagination + Jade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul.pagination.right() | |
// if current page is > 10, have -10 back btn | |
li.arrow(ng-if="currentPage > 10") | |
a(ng-click='goToPage(currentPage - 10)') «« | |
// have previous & nect page as clicable option | |
li(ng-repeat='n in [-1, 0, 1]' ng-class="{current: currentPage == currentPage + n}") | |
a(ng-if="currentPage + n > 0 && (currentPage + n) < (total / 10)", | |
ng-click='goToPage(currentPage + n)') {{currentPage + n}} | |
// Next btn, if next exists | |
li.arrow(ng-if="currentPage < (total / 10) + 3 && (currentPage + 3) < (total / 10)") | |
a(ng-click='goToPage(currentPage + 3)') » | |
// if There is more to go, have a +10 btn option | |
li.arrow(ng-if="currentPage < ((total / 10) - 10)") | |
a(ng-click='goToPage(currentPage + 10)') »» |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment