Skip to content

Commit d80a356

Browse files
committed
add static true to query for column def
1 parent 4342483 commit d80a356

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/cdk/table/text-column.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import {
1818
ViewChild,
1919
ViewEncapsulation
2020
} from '@angular/core';
21-
2221
import {CdkColumnDef} from './cell';
2322
import {CdkTable} from './table';
2423
import {getTableTextColumnMissingParentTableError} from './table-errors';
2524

25+
2626
/** Configurable options for `CdkTextColumn`. */
2727
export interface TextColumnOptions<T> {
2828
/**
@@ -99,7 +99,7 @@ export class CdkTextColumn<T> implements OnDestroy, OnInit {
9999
/** Alignment of the cell values. */
100100
@Input() justify: 'start'|'end' = 'start';
101101

102-
@ViewChild(CdkColumnDef) columnDef: CdkColumnDef;
102+
@ViewChild(CdkColumnDef, {static: true}) columnDef: CdkColumnDef;
103103

104104
constructor(
105105
@Optional() private table: CdkTable<T>,

src/lib/table/text-column.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/co
4040
// tslint:disable-next-line:validate-decorators
4141
changeDetection: ChangeDetectionStrategy.Default,
4242
})
43-
export class MatTextColumn<T> extends CdkTextColumn<T> {}
43+
export class MatTextColumn<T> extends CdkTextColumn<T> {
44+
}

0 commit comments

Comments
 (0)