search

Home  >  Q&A  >  body text

angular.js - How to implement li in angularJs to only display the first 4 data, and want to use ng-repeat to achieve it

How to implement li in angularJs to only display the first 4 data. I want to use ng-repeat to achieve it. But ng-repeat will traverse all the data by default. I hope to only list the first 4. Is there any way to achieve this?

某草草某草草2826 days ago484

reply all(1)I'll reply

  • 某草草

    某草草2017-05-15 16:56:37

    <p ng-repeat="item in items | limitTo: 4">
        <p>....</p>
    </p>

    reply
    0
  • Cancelreply