Home How to re-order the angularjs ngTable pagination?
Reply: 0

How to re-order the angularjs ngTable pagination?

user1333 Published in August 15, 2018, 5:37 am

I'm using angularjs 1.5.7 in my current project. I use ngTable almost everywhere in this project. Lately I've been asked to change the way we show pagination on top of each table. Our current format:

We want to have:

Here is my code snippet:

<ul class="pagination">
    <li ng-class="{'disabled': !page.active}" ng-repeat="page in pages" ng-switch="page.type">
        <a ng-switch-when="first" ng-click="params.page(page.number)" href="" translate>TABLE.FIRST</a>
        <a ng-switch-when="prev" ng-click="params.page(page.number)" href="" translate>TABLE.PREVIOUS</a>
        <a ng-switch-when="next" ng-click="params.page(page.number)" href="" translate>TABLE.NEXT</a>
        <a ng-switch-when="last" ng-click="params.page(page.number)" href="" translate>TABLE.LAST</a>

    <li ng-if="params.pages < 2" ng-class="{'disabled':true}" ng-repeat="n in ['«','1','»']">
        <a type="button" ng-click="" href="" ng-bind="n"></a>

Unfortunately, I can't get it in order of: First>Prev>Next>Last. What I get instead is:

I was wondering if there is a way to force it to appear in the order I want?


You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.292758 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO