Coder Social home page Coder Social logo

Comments (3)

daniel-nagy avatar daniel-nagy commented on July 30, 2024

Are you trying to achieve pagination on the server side or client side? As long a $digest is performed when new data is pushed from Socket.io to the client I believe ng-repeat should be able to handle that just fine.

I think the problem might be that you are not actually implementing the pagination. Simply assigning values to the attributes on the md-data-table-pagination directive will not enable pagination. The easiest way to do pagination is in the client using the built in pipe functionality of ng-repeat. For example,

<tr ng-repeat="item in array | orderBy: myOrder | filter: mySkip | limitTo: myLimit">

You can implement a simple skip function in your controller like so,

$scope.mySkip = function (item, index) {
    return index >= ($scope.myLimit * ($scope.myPage - 1));
  };

The demo provided takes advantage of ng-repeat to do client-side pagination.

Your english is better than some people I know who speak it natively :)

from md-data-table.

matiaslabra avatar matiaslabra commented on July 30, 2024

Thank you ! completely forget about ng-repeat filters ...sometimes just have to see bigger lol, in a complement way you can point this on documentation maybe can help people who is starting with angular like me 😃

from md-data-table.

daniel-nagy avatar daniel-nagy commented on July 30, 2024

I'm happy you got it working! I can provide this code in the documentation for pagination.

from md-data-table.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.