diff --git a/projects/igniteui-angular/src/lib/core/utils.ts b/projects/igniteui-angular/src/lib/core/utils.ts index 5a0ed725ae7..7a475350937 100644 --- a/projects/igniteui-angular/src/lib/core/utils.ts +++ b/projects/igniteui-angular/src/lib/core/utils.ts @@ -509,6 +509,8 @@ export const yieldingLoop = (count: number, chunkSize: number, callback: (index: chunk(); }; +export const isConstructor = (ref: any) => typeof ref === 'function' && Boolean(ref.prototype) && Boolean(ref.prototype.constructor); + export const mkenum = (x: T) => x; export const reverseAnimationResolver = (animation: AnimationReferenceMetadata): AnimationReferenceMetadata => diff --git a/projects/igniteui-angular/src/lib/grids/columns/column.component.ts b/projects/igniteui-angular/src/lib/grids/columns/column.component.ts index 0058f32684f..74ec4db4de0 100644 --- a/projects/igniteui-angular/src/lib/grids/columns/column.component.ts +++ b/projects/igniteui-angular/src/lib/grids/columns/column.component.ts @@ -34,7 +34,7 @@ import { GridType } from '../common/grid.interface'; import { IgxGridHeaderComponent } from '../headers/grid-header.component'; import { IgxGridFilteringCellComponent } from '../filtering/base/grid-filtering-cell.component'; import { IgxGridHeaderGroupComponent } from '../headers/grid-header-group.component'; -import { getNodeSizeViaRange } from '../../core/utils'; +import { getNodeSizeViaRange, isConstructor } from '../../core/utils'; import { IgxSummaryOperand, IgxNumberSummaryOperand, IgxDateSummaryOperand, IgxCurrencySummaryOperand, IgxPercentSummaryOperand } from '../summaries/grid-summary'; import { @@ -954,7 +954,9 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy { * @memberof IgxColumnComponent */ public set summaries(classRef: any) { - this._summaries = new classRef(); + if (isConstructor(classRef)) { + this._summaries = new classRef(); + } if (this.grid) { this.grid.summaryService.removeSummariesCachePerColumn(this.field);