angular.js - ng-if the first piece of data is not displayed
淡淡烟草味
淡淡烟草味 2017-05-15 17:07:17
0
2
807

Achieve displaying 6 pieces of data per page, but the first piece of data is not displayed, start directly from the second piece

淡淡烟草味
淡淡烟草味

reply all(2)
迷茫

index starts from 0

滿天的星座

In fact, you can just change ng-if to write like this:
ng-if="$index <= pagenum * 6 && $index >= (pagenum - 1) * 6"

When

$index is 0, the first condition is met, so the return value is the second condition. And 0 is not greater than 0, so return false

If you are writing pagination, consider using filter 写可能会比较好,不需要用 ng-if

In addition, it is customary to process data, such as your txt.split('|'), in the controller, rather than in html.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template