1.0.3 • Published 6 years ago
pt.ang-datatable v1.0.3
PT.AngDatatable
This is an Angular Datatable Module. For the moment, this only includes a PaginationComponent, to automatically make your pagination in your table.
Installation
Run this command at the root of your project :
npm install pt.ang-datatable
Import it in your AppModule :
import { PaginationModule } from 'pt.ang-datatable';
@NgModule({
...
imports: [
...
PaginationModule
],
...
})
Usage
- Create your HTML and your table, as normally. Example :
<table class="table card-table table-vcenter text-nowrap">
<thead>
<tr>
<th>Acronyme</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let user of showedList">
<td><span class="text-muted">{{user.Acronym}}</span></td>
</tr>
</tbody>
</table>
- After your
table
closing tag, add the pagination selector :
<pagination
(outputArray)="showedList = $event"
[pagesToShow]="3"
[page]="1"
[perPage]="25"
[ListArray]="usersList">
</pagination>
- outputArray: this is your list the PaginationComponent have pagined
- pagesToShow: number of buttons that will be displayed
- page: this is the current page(by default)
- perPage: number of element per page
- ListArray: send your array you want to paginate