diff --git a/projects/ng-datatable/package.json b/projects/ng-datatable/package.json index a49f7aa..449808b 100644 --- a/projects/ng-datatable/package.json +++ b/projects/ng-datatable/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/ng-datatable", - "version": "1.6.4", + "version": "1.6.5", "homepage": "https://github.com/ztimson/ng-datatable", "license": "Apache-2.0", "author": { diff --git a/projects/ng-datatable/src/lib/ng-datatable.component.ts b/projects/ng-datatable/src/lib/ng-datatable.component.ts index f855fc2..ee6b824 100644 --- a/projects/ng-datatable/src/lib/ng-datatable.component.ts +++ b/projects/ng-datatable/src/lib/ng-datatable.component.ts @@ -36,7 +36,7 @@ export class NgDatatableComponent implements OnInit { width = window.innerWidth; // Width of the screen. Used for hiding mobile columns // Fields ============================================================================================================ - get count(): number { return this.processedData.length; } // Number of rows after filtering + get count(): number { return this.processedData ? this.processedData.length : 0; } // Number of rows after filtering private _data: any[] = []; // Original data entered into table get data(): any[] { return this.processedData; } // Return the processed data @Input() set data(data: any[]) {