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.
2 parents 3488f8e + f49970f commit 8515022Copy full SHA for 8515022
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);
+ const 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