Skip to content

Commit 8e7dd80

Browse files
andrewseguinjelbourn
authored andcommitted
fix(table): add missing constructors (#11252)
1 parent 56b884c commit 8e7dd80

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

src/lib/table/cell.ts

Lines changed: 19 additions & 4 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} from '@angular/core';
9+
import {Directive, ElementRef, Input, TemplateRef} from '@angular/core';
1010
import {
1111
CdkCell,
1212
CdkCellDef,
@@ -23,7 +23,12 @@ import {
2323
selector: '[matCellDef]',
2424
providers: [{provide: CdkCellDef, useExisting: MatCellDef}]
2525
})
26-
export class MatCellDef extends CdkCellDef { }
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+
}
2732

2833
/**
2934
* Header cell definition for the mat-table.
@@ -33,7 +38,12 @@ export class MatCellDef extends CdkCellDef { }
3338
selector: '[matHeaderCellDef]',
3439
providers: [{provide: CdkHeaderCellDef, useExisting: MatHeaderCellDef}]
3540
})
36-
export class MatHeaderCellDef extends CdkHeaderCellDef { }
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+
}
3747

3848
/**
3949
* Footer cell definition for the mat-table.
@@ -43,7 +53,12 @@ export class MatHeaderCellDef extends CdkHeaderCellDef { }
4353
selector: '[matFooterCellDef]',
4454
providers: [{provide: CdkFooterCellDef, useExisting: MatFooterCellDef}]
4555
})
46-
export class MatFooterCellDef extends CdkFooterCellDef { }
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+
}
4762

4863
/**
4964
* Column definition for the mat-table.

src/lib/table/row.ts

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

9-
import {ChangeDetectionStrategy, Component, Directive, ViewEncapsulation} from '@angular/core';
9+
import {
10+
ChangeDetectionStrategy,
11+
Component,
12+
Directive,
13+
IterableDiffers, TemplateRef,
14+
ViewEncapsulation
15+
} from '@angular/core';
1016
import {
1117
CDK_ROW_TEMPLATE, CdkFooterRow, CdkFooterRowDef,
1218
CdkHeaderRow,
@@ -24,7 +30,12 @@ import {
2430
providers: [{provide: CdkHeaderRowDef, useExisting: MatHeaderRowDef}],
2531
inputs: ['columns: matHeaderRowDef'],
2632
})
27-
export class MatHeaderRowDef extends CdkHeaderRowDef { }
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+
}
2839

2940
/**
3041
* Footer row definition for the mat-table.
@@ -35,7 +46,12 @@ export class MatHeaderRowDef extends CdkHeaderRowDef { }
3546
providers: [{provide: CdkFooterRowDef, useExisting: MatFooterRowDef}],
3647
inputs: ['columns: matFooterRowDef'],
3748
})
38-
export class MatFooterRowDef extends CdkFooterRowDef { }
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+
}
3955

4056
/**
4157
* Data row definition for the mat-table.
@@ -48,6 +64,10 @@ export class MatFooterRowDef extends CdkFooterRowDef { }
4864
inputs: ['columns: matRowDefColumns', 'when: matRowDefWhen'],
4965
})
5066
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+
}
5171
}
5272

5373
/** Footer template container that contains the cell outlet. Adds the right class and role. */

0 commit comments

Comments
 (0)