Similar to this question but angular specific:
I only want to show at most 5 pages at a time in the pagination. If possible current page should be centered. a brief illustration:
< [1] 2 3 4 5 > // not centered
< 1 [2] 3 4 5 > // not centered
< 1 2 [3] 4 5 > // centered
< 2 3 [4] 5 6 > // remains centered
< 3 4 [5] 6 7 > // remains centered
I'm at a loss for how to approach this.
This is what my view looks like:
<section>
<div class="center">
<nav aria-label="Page navigation">
<ul class="pagination">
<li class="previous" ng-class="{ 'disabled': prevDisabled }">
<a href="#" ng-click="seek(page-1)" aria-label="Previous">
<i class="arrow_left"></i>
</a>
</li>
<li ng-repeat="(key,val) in pages" ng-class="{'active': key == page }"><a href="#" ng-click="seek(key)">{{key}}</a></li>
<li class="next" ng-class="{ 'disabled': nextDisabled }">
<a href="#" ng-click="seek(page+1)" aria-label="Next">
<i class="arrow_right"></i>
</a>
</li>
</ul>
</nav>
</div>
</section>