Skip to content

Commit 79dd48a

Browse files
MKirovaMKirova
authored andcommitted
Change getter to methods so that it can be called with super. Add some doc info.
1 parent c843abe commit 79dd48a

File tree

2 files changed

+43
-11
lines changed

2 files changed

+43
-11
lines changed

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid-aggregate.ts

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ import { IPivotAggregator } from './pivot-grid.interface';
33

44

55
export class IgxPivotAggregate {
6-
public get aggregators() {
6+
/**
7+
* Gets array with default aggregator function for base aggregation.
8+
* ```typescript
9+
* IgxPivotAggregate.aggregators();
10+
* ```
11+
*
12+
* @memberof IgxPivotAggregate
13+
*/
14+
public static aggregators() {
715
return [{
816
key: 'count',
917
label: 'Count',
@@ -26,9 +34,17 @@ export class IgxPivotAggregate {
2634

2735
export class IgxPivotNumericAggregate extends IgxPivotAggregate {
2836

29-
public get aggregators() {
37+
/**
38+
* Gets array with default aggregator function for numeric aggregation.
39+
* ```typescript
40+
* IgxPivotAggregate.aggregators();
41+
* ```
42+
*
43+
* @memberof IgxPivotAggregate
44+
*/
45+
public static aggregators() {
3046
let result: IPivotAggregator[] = [];
31-
result = result.concat(super.aggregators);
47+
result = result.concat(super.aggregators());
3248
result.push({
3349
key: 'min',
3450
label: 'Min',
@@ -108,9 +124,17 @@ export class IgxPivotNumericAggregate extends IgxPivotAggregate {
108124
}
109125

110126
export class IgxPivotDateAggregate extends IgxPivotAggregate {
111-
public get aggregators() {
127+
/**
128+
* Gets array with default aggregator function for date aggregation.
129+
* ```typescript
130+
* IgxPivotDateAggregate.aggregators();
131+
* ```
132+
*
133+
* @memberof IgxPivotAggregate
134+
*/
135+
public static aggregators() {
112136
let result: IPivotAggregator[] = [];
113-
result = result.concat(super.aggregators);
137+
result = result.concat(super.aggregators());
114138
result.push({
115139
key: 'latest',
116140
label: 'Latest',
@@ -151,9 +175,17 @@ export class IgxPivotDateAggregate extends IgxPivotAggregate {
151175
}
152176

153177
export class IgxPivotTimeAggregate extends IgxPivotAggregate {
154-
public get aggregators() {
178+
/**
179+
* Gets array with default aggregator function for time aggregation.
180+
* ```typescript
181+
* IgxPivotTimeAggregate.aggregators();
182+
* ```
183+
*
184+
* @memberof IgxPivotAggregate
185+
*/
186+
public static aggregators() {
155187
let result: IPivotAggregator[] = [];
156-
result = result.concat(super.aggregators);
188+
result = result.concat(super.aggregators());
157189
result.push({
158190
key: 'latestTime',
159191
label: 'Latest Time',

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-header-row.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,14 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent implem
307307
switch (dataType) {
308308
case GridColumnDataType.Number:
309309
case GridColumnDataType.Currency:
310-
return new IgxPivotNumericAggregate().aggregators;
310+
return IgxPivotNumericAggregate.aggregators();
311311
case GridColumnDataType.Date:
312312
case GridColumnDataType.DateTime:
313-
return new IgxPivotDateAggregate().aggregators;
313+
return IgxPivotDateAggregate.aggregators();
314314
case GridColumnDataType.Time:
315-
return new IgxPivotTimeAggregate().aggregators;
315+
return IgxPivotTimeAggregate.aggregators();
316316
default:
317-
return new IgxPivotAggregate().aggregators;
317+
return IgxPivotAggregate.aggregators();
318318
}
319319
}
320320

0 commit comments

Comments
 (0)