From 631db315666de94b4a20974b1056e0984f56fe13 Mon Sep 17 00:00:00 2001 From: Mike Becker Date: Wed, 25 Oct 2023 14:32:19 +0200 Subject: [PATCH] fix typos --- .../src/lib/components/pager/pager.component.ts | 8 ++++---- .../src/lib/lib/data-source/server/server.data-source.ts | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/projects/angular2-smart-table/src/lib/components/pager/pager.component.ts b/projects/angular2-smart-table/src/lib/components/pager/pager.component.ts index 9ff9b693d..182ac5f1a 100644 --- a/projects/angular2-smart-table/src/lib/components/pager/pager.component.ts +++ b/projects/angular2-smart-table/src/lib/components/pager/pager.component.ts @@ -1,7 +1,7 @@ import {Component, Input, OnChanges, SimpleChanges} from '@angular/core'; import {Subscription} from 'rxjs'; -import {DataSource} from '../../lib/data-source/data-source'; +import {DataSource, DataSourceChangeEvent} from '../../lib/data-source/data-source'; @Component({ selector: 'angular2-smart-table-pager', @@ -85,7 +85,7 @@ export class PagerComponent implements OnChanges { this.perPage = this.source.getPaging().perPage; this.currentPerPage = this.perPage; this.count = this.source.count(); - if (this.isPageOutOfBounce()) { + if (this.isPageOutOfBounds()) { this.source.setPage(--this.page); } @@ -101,7 +101,7 @@ export class PagerComponent implements OnChanges { * if a new element was added to the beginning of the table - then to the first page * @param changes */ - processPageChange(changes: any) { + processPageChange(changes: DataSourceChangeEvent) { if (changes.action === 'prepend') { this.source.setPage(1); } @@ -140,7 +140,7 @@ export class PagerComponent implements OnChanges { return Math.ceil(this.count / this.perPage); } - isPageOutOfBounce(): boolean { + isPageOutOfBounds(): boolean { return (this.page * this.perPage) >= (this.count + this.perPage) && this.page > 1; } diff --git a/projects/angular2-smart-table/src/lib/lib/data-source/server/server.data-source.ts b/projects/angular2-smart-table/src/lib/lib/data-source/server/server.data-source.ts index c262a2400..51b3ce809 100644 --- a/projects/angular2-smart-table/src/lib/lib/data-source/server/server.data-source.ts +++ b/projects/angular2-smart-table/src/lib/lib/data-source/server/server.data-source.ts @@ -64,13 +64,12 @@ export class ServerDataSource extends LocalDataSource { return data; } - throw new Error(`Data must be an array. - Please check that data extracted from the server response by the key '${this.conf.dataKey}' exists and is array.`); + throw new Error(`Data must be an array. Please check that data extracted from the server response by the key '${this.conf.dataKey}' exists and is array.`); } /** * Extracts total rows count from the server response - * Looks for the count in the heders first, then in the response body + * Looks for the count in the headers first, then in the response body * @param res * @returns {any} */