Feature: Paged customer list.
This commit is contained in:
17
bookie/src/app/core/paged-result.ts
Normal file
17
bookie/src/app/core/paged-result.ts
Normal file
@ -0,0 +1,17 @@
|
||||
export class PagedResult<T> {
|
||||
items: T[];
|
||||
page: number; // current page (zero-based)
|
||||
pageSize: number; // items per page
|
||||
total: number; // total items in all pages
|
||||
totalPages: number;
|
||||
field?: string; // active sort column
|
||||
sortDirection?: 'asc' | 'desc'; // sort direction
|
||||
|
||||
constructor(items: T[], page: number, pageSize: number, total: number) {
|
||||
this.items = items;
|
||||
this.page = page;
|
||||
this.pageSize = pageSize;
|
||||
this.total = total;
|
||||
this.totalPages = Math.ceil(total / pageSize);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user