Skip to content

Commit c2190e4

Browse files
crisbetommalerba
authored andcommitted
refactor(table): remove redundant constructors (#12301)
Removes some redundant constructors that were added as a workaround for a compiler issue that's been fixed since 6.0.
1 parent b9c0d85 commit c2190e4

File tree

2 files changed

+7
-38
lines changed

2 files changed

+7
-38
lines changed

src/lib/table/cell.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {Directive, ElementRef, Input, TemplateRef} from '@angular/core';
9+
import {Directive, ElementRef, Input} from '@angular/core';
1010
import {
1111
CdkCell,
1212
CdkCellDef,
@@ -23,12 +23,7 @@ import {
2323
selector: '[matCellDef]',
2424
providers: [{provide: CdkCellDef, useExisting: MatCellDef}]
2525
})
26-
export class MatCellDef extends CdkCellDef {
27-
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
28-
constructor(/** @docs-private */ public template: TemplateRef<any>) {
29-
super(template);
30-
}
31-
}
26+
export class MatCellDef extends CdkCellDef {}
3227

3328
/**
3429
* Header cell definition for the mat-table.
@@ -38,12 +33,7 @@ export class MatCellDef extends CdkCellDef {
3833
selector: '[matHeaderCellDef]',
3934
providers: [{provide: CdkHeaderCellDef, useExisting: MatHeaderCellDef}]
4035
})
41-
export class MatHeaderCellDef extends CdkHeaderCellDef {
42-
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
43-
constructor(/** @docs-private */ public template: TemplateRef<any>) {
44-
super(template);
45-
}
46-
}
36+
export class MatHeaderCellDef extends CdkHeaderCellDef {}
4737

4838
/**
4939
* Footer cell definition for the mat-table.
@@ -53,12 +43,7 @@ export class MatHeaderCellDef extends CdkHeaderCellDef {
5343
selector: '[matFooterCellDef]',
5444
providers: [{provide: CdkFooterCellDef, useExisting: MatFooterCellDef}]
5545
})
56-
export class MatFooterCellDef extends CdkFooterCellDef {
57-
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
58-
constructor(/** @docs-private */ public template: TemplateRef<any>) {
59-
super(template);
60-
}
61-
}
46+
export class MatFooterCellDef extends CdkFooterCellDef {}
6247

6348
/**
6449
* Column definition for the mat-table.

src/lib/table/row.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
ChangeDetectionStrategy,
1111
Component,
1212
Directive,
13-
IterableDiffers, TemplateRef,
1413
ViewEncapsulation
1514
} from '@angular/core';
1615
import {
@@ -30,12 +29,7 @@ import {
3029
providers: [{provide: CdkHeaderRowDef, useExisting: MatHeaderRowDef}],
3130
inputs: ['columns: matHeaderRowDef', 'sticky: matHeaderRowDefSticky'],
3231
})
33-
export class MatHeaderRowDef extends CdkHeaderRowDef {
34-
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
35-
constructor(template: TemplateRef<any>, _differs: IterableDiffers) {
36-
super(template, _differs);
37-
}
38-
}
32+
export class MatHeaderRowDef extends CdkHeaderRowDef {}
3933

4034
/**
4135
* Footer row definition for the mat-table.
@@ -46,12 +40,7 @@ export class MatHeaderRowDef extends CdkHeaderRowDef {
4640
providers: [{provide: CdkFooterRowDef, useExisting: MatFooterRowDef}],
4741
inputs: ['columns: matFooterRowDef', 'sticky: matFooterRowDefSticky'],
4842
})
49-
export class MatFooterRowDef extends CdkFooterRowDef {
50-
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
51-
constructor(template: TemplateRef<any>, _differs: IterableDiffers) {
52-
super(template, _differs);
53-
}
54-
}
43+
export class MatFooterRowDef extends CdkFooterRowDef {}
5544

5645
/**
5746
* Data row definition for the mat-table.
@@ -63,12 +52,7 @@ export class MatFooterRowDef extends CdkFooterRowDef {
6352
providers: [{provide: CdkRowDef, useExisting: MatRowDef}],
6453
inputs: ['columns: matRowDefColumns', 'when: matRowDefWhen'],
6554
})
66-
export class MatRowDef<T> extends CdkRowDef<T> {
67-
// TODO(andrewseguin): Remove this constructor after compiler-cli is updated; see issue #9329
68-
constructor(template: TemplateRef<any>, _differs: IterableDiffers) {
69-
super(template, _differs);
70-
}
71-
}
55+
export class MatRowDef<T> extends CdkRowDef<T> {}
7256

7357
/** Footer template container that contains the cell outlet. Adds the right class and role. */
7458
@Component({

0 commit comments

Comments
 (0)