Pagination in Angular
- install pagination. npm install ngx-pagination
- import pagination and HttpClientModul in app.module.ts
- import HttpClient and Observable in your component.ts file
- Your method for HTTP call that is showing results should be observable.
getAllCoup( currentPage: number, filter: any ): Observable<any>{ this.allCoupns = "https://adscombined.com/v1/public/api/FilterCoupons?Filter="+filter+"&SubType=&Page="+currentPage+"&PerPage=60"; return this.allCoupons.post( this.allCoupns, {} ); } - add | paginate. (((
)))<div class="col-12" *ngFor="let fCoup of filteredCategoryCoupons | paginate:{currentPage: currentPage,itemsPerPage: perPage,totalItems: TotalCouponsCount}; let i = index">