0.0.8 • Published 3 years ago

dv-pagination v0.0.8

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

DvPagination

This project was generated with Angular CLI version 14.1.0.

Angular Pagination Code

Usage instructions available at https://github.com/pateldharmendra123/dv-pagination/


Add this code in component ts File


items:any = [];
  pageOfItems: Array<any>;

  constructor() { }

  ngOnInit() {
      // an example array of 150 items to be paged
      this.items = Array(150).fill(0).map((x, i) => ({ id: (i + 1), name: `Item ${i + 1}`}));
      console.log(this.items);
  }

  onChangePage(pageOfItems:any) { 
      console.log(pageOfItems);
      // update current page of items
      this.pageOfItems = pageOfItems;
  }

Add this code in HTML Page


 <div class="card-body">
      <div *ngFor="let item of pageOfItems">{{item.name}}</div>
  </div>
  <div class="card-footer pb-0 pt-3"> 
      <dv-pagination [items]="items" (changePage)="onChangePage($event)"></dv-pagination>  
  </div> 
0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago