Skip to content

Commit 35cdaf4

Browse files
committed
refactor(material-experimental/selection): fix strict property initialization errors
Updates the code to be compatible with strict property initialization.
1 parent a7f4347 commit 35cdaf4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/material-experimental/selection/selection-column.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ export class MatSelectionColumn<T> implements OnInit, OnDestroy {
8686

8787
this._syncColumnDefName();
8888
}
89-
private _name: string;
89+
private _name!: string;
9090

91-
@ViewChild(MatColumnDef, {static: true}) private readonly _columnDef: MatColumnDef;
92-
@ViewChild(MatCellDef, {static: true}) private readonly _cell: MatCellDef;
91+
@ViewChild(MatColumnDef, {static: true}) private readonly _columnDef!: MatColumnDef;
92+
@ViewChild(MatCellDef, {static: true}) private readonly _cell!: MatCellDef;
9393
@ViewChild(MatHeaderCellDef, {static: true})
94-
private readonly _headerCell: MatHeaderCellDef;
94+
private readonly _headerCell!: MatHeaderCellDef;
9595

9696
ngOnInit() {
9797
if (!this.selection && (typeof ngDevMode === 'undefined' || ngDevMode)) {

src/material-experimental/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"compilerOptions": {
55
"rootDir": "..",
66
"baseUrl": ".",
7+
"strictPropertyInitialization": true,
78
"paths": {
89
"@angular/cdk/*": ["../cdk/*"],
910
"@angular/material/*": ["../material/*"],

0 commit comments

Comments
 (0)