Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
uap-universe committed Oct 25, 2023
1 parent b385ac3 commit 631db31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
}
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
*/
Expand Down

0 comments on commit 631db31

Please sign in to comment.