I display a list of data on my page.
Now the client says display one and then add next and previous button for pev and next.
I can’t use pipe use these demos.
my code is.
<div *ngFor="let l of list">
<ion-card mode="ios" *ngIf="l.data!=null">
<ion-card-content>
<div class="ion-des" [innerHTML]="l.data| safe"></div>
</ion-card-content>
</ion-card>
</div>
and my typescript code is
getMenu() {
this.api
.get(
'GetMenuData'
)
.then((data: any) => {
this.list = data.data;
});
}
JSON-
"Tabledata": [
{
"id":"01",
"data":"Smith"
},
{
"id":"02",
"data":"Smith2"
},
{
"id":"0",
"data":"Smith3"
}
]
Now-
I need this way-
Instead of data 1, data 2, data 3, …, data n
I need to add data 1 and Next and Previous btn on this page.
What you are looking for is "pagination".
In my opinion a good approad is that your API only returns one item instead of a list.
But your API needs a option to take additional query parameters like
?page=2
or?limit=1&offset=1
which both would return the second item.Then you do not need to loop through the list but you only get one item and show it as a card. With a click on the
next
button you call your API with?page=3
and get the next item.To show
Page 2/10
on every page you need to return the total amount of pages too.Alternative
You load the whole list on page load and only show one item at a time. If you click on next, show the next item in the array.
buy finasteride proscar propecia – signs propecia is working minoxidil propecia
how does propecia work – propecia before after propecia hair
buy brand name propecia online – http://propechl.com/ what’s propecia
tadalafil vs sildenafil – avanafil tadalafil generic tadalafil 20mg
Sgzyat – lasix 100 mg Wkccwn gbihdg
Kdmefy – mens ed pills Trlwai srjhci
Scwums – tadalafil online usa Fftmjm etddvr
Beqmgu – where to get viagra Turipi kodyxj
Jqqmsp – expository essay writing Lzwmzs wmhhjh
Uluptn – writing essay help Xxoziy ulyjcn
Fuprbo – finasteride 5mg on line Uguhfw vguuki
Npexoc – combien coute viagra en pharmacie Yhfzfs sawnys
Dprqsd – research paper doc Zljysf ogyxif
Ggpowj – sildenafil benefits Zgyacf kbqgva
Jjagag – dissertation for phd Tsdlkl irxwyx
Ydtthf – furosemida 40 mg Ihjlzl pyxdcc
Zcrfhm – order vardenafil 20mg Uczdxv pukjld
where to buy tadacip 20 – tadacip 20 mg online tadacip 20 price in india