search

Home  >  Q&A  >  body text

angular.js - How to arrange serial numbers according to order in angularjs, reading from pagination?

Now, 20 pieces of data are read from each page of the database.
Now using a {{$index 1}} can only display from 1 to 20 every time.
However, I want to start from the first page. The 1 on one page is displayed until 100,200... like this.
How to achieve it? <td data-title="'Serial Number'">{{$index 1}}</td>

For example, the current situation is

First page
Serial number
1
2
3

Second page
Serial number
1
2
3

If you want to change it to:

First page
Serial number
1
2
3

Second page
Serial number
4
5
6

PHP中文网PHP中文网2815 days ago519

reply all(1)I'll reply

  • 某草草

    某草草2017-05-15 17:04:11

    Lazy way: add an id field in the background and just display it on the front end

    For the front-end cover method, calculate it yourself based on the page number,
    pagenumber x pagesize plus $index

    reply
    0
  • Cancelreply