In my Angular 7 Typescript class, I have the following setup:
export class Paging {
itemCount: number;
pageCount: number;
pageNumber: number;
pageSize: number;
constructor(pageNumber: number, pageSize: number, itemCount: number) {
this.itemCount = itemCount;
this.pageCount = itemCount > 0 ? Math.ceil(itemCount / pageSize) : 0;
this.pageNumber = pageNumber;
this.pageSize = pageSize;
}
}
I'm facing two issues:
1. How can I successfully import Math functions without encountering an error?
2. Is there a way to convert the calculation result from Math.ceil(itemCount / pageSize)
into an integer?