I try apply pagination in angular4 but I don't khnow how to apply limit in pagination .. limit : for example I have 1000 pagination how to display in the first 5 pagination then ... then last page : 1 2 3 4 5 .... 1000. in my code I display all pagination 1000 pagination but isn't not good design for client:
code component:
addClass(x)
{
$(".page-item").click(function () {
$(this).addClass("current").siblings().removeClass('current');
});
}
next()
{
$('.current').next('.page-item').trigger('click');
}
previous()
{
$('.current').prev('.page-item').trigger('click');
}
code html:
<ul>
<li class="previous" (click)="previous()">Previous</li>
<li class="next" (click)="next()">Next</li>
</ul>
<ul class="pagination">
<li *ngFor="let x of pages" class='page-item' (click)='addClass(x)'>
{{x}}
</li>
and this is screenshot of display in my page:
Some hint:
You can try ngx-pagination v3.1.0
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.