Default processed data to prevent count calling length on null
This commit is contained in:
parent
5f5abe7fc2
commit
dc6ee49467
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ztimson/ng-datatable",
|
"name": "@ztimson/ng-datatable",
|
||||||
"version": "1.6.4",
|
"version": "1.6.5",
|
||||||
"homepage": "https://github.com/ztimson/ng-datatable",
|
"homepage": "https://github.com/ztimson/ng-datatable",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -36,7 +36,7 @@ export class NgDatatableComponent implements OnInit {
|
|||||||
width = window.innerWidth; // Width of the screen. Used for hiding mobile columns
|
width = window.innerWidth; // Width of the screen. Used for hiding mobile columns
|
||||||
|
|
||||||
// Fields ============================================================================================================
|
// 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
|
private _data: any[] = []; // Original data entered into table
|
||||||
get data(): any[] { return this.processedData; } // Return the processed data
|
get data(): any[] { return this.processedData; } // Return the processed data
|
||||||
@Input() set data(data: any[]) {
|
@Input() set data(data: any[]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user