Display range records id from list order

Hello,

I’m trying to find proper way to display limited range of records from search results list on .html page:

    <ion-list no-lines>
      <ion-item-divider *ngFor="let res of search" class="ion-card">
        <div> ID: {{res.ID}} </div>
        <div> User: {{res.user}} </div>
      </ion-item-divider>
    </ion-list>

With possibility to display next or previous two IDs range from list order by increment/decrement counter for example.

If private search: any[] = []; contains records 12, 36, 69, 72, 90 which is a json strings in my case, with load I want display only first two records:

ID: 12
User: 78623786236784239678
__________________________
ID: 36
User: 31556854673457367356
__________________________

click on next button, second:

ID: 69
User: 45634564567886767777
__________________________
ID: 72
User: 34578566565565533222
__________________________

last one should be:

ID: 90
User: 53545645444336700458
__________________________

Hello,

maybe you shoud bind to an array that holds only the amount of data you need. With button click change content of array.

Best regards, anna-liebt

2 Likes

@anna_liebt Thank you