Skip to content

Instantly share code, notes, and snippets.

@NazemMahmud
Last active December 18, 2021 10:39
Show Gist options
  • Save NazemMahmud/0108aedd88c706a513f06fc37fc63a35 to your computer and use it in GitHub Desktop.
Save NazemMahmud/0108aedd88c706a513f06fc37fc63a35 to your computer and use it in GitHub Desktop.
Angular Material: main component html file for pagination sample
<table mat-table *ngIf="dataSource; else noDataFound" [dataSource]="dataSource">
<!-- Name Column -->
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name</th>
<td mat-cell *matCellDef="let row"> {{row.name}} </td>
</ng-container>
<!-- Email Column -->
<ng-container matColumnDef="email">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Email </th>
<td mat-cell *matCellDef="let row"> {{row.email}} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<ng-template #noDataFound>
<h1> No Data Found </h1>
</ng-template>
<basic-pagination [length]="total" [pageOffset]="pageOffset" [pageIndex]="pageIndex"></basic-pagination>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment