We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8050482 commit 8b7a5d0Copy full SHA for 8b7a5d0
src/pagination/pagination.component.ts
@@ -231,11 +231,12 @@ export class Pagination {
231
* @memberof Pagination
232
*/
233
get lastPage(): number {
234
- return Math.ceil(this.model.totalDataLength / this.model.pageLength);
+ let last = Math.ceil(this.model.totalDataLength / this.model.pageLength);
235
+ return last !== 0 ? last : 1;
236
}
237
238
get startItemIndex() {
- return (this.currentPage - 1) * this.model.pageLength + 1;
239
+ return this.endItemIndex !== 0 ? (this.currentPage - 1) * this.model.pageLength + 1 : 0;
240
241
242
get endItemIndex() {
0 commit comments