File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -213,14 +213,15 @@ export class CdkTable<T> implements CollectionViewer {
213
213
ngAfterViewInit ( ) {
214
214
// Find and construct an iterable differ that can be used to find the diff in an array.
215
215
this . _dataDiffer = this . _differs . find ( [ ] ) . create ( this . _trackByFn ) ;
216
-
217
- this . _renderHeaderRow ( ) ;
218
216
this . _isViewInitialized = true ;
219
217
}
220
218
221
219
ngDoCheck ( ) {
222
220
if ( this . _isViewInitialized && this . dataSource && ! this . _renderChangeSubscription ) {
223
- this . _observeRenderChanges ( ) ;
221
+ this . _renderHeaderRow ( ) ;
222
+ if ( this . dataSource && ! this . _renderChangeSubscription ) {
223
+ this . _observeRenderChanges ( ) ;
224
+ }
224
225
}
225
226
}
226
227
Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ import {getMdSortHeaderNotContainedWithinMdSortError} from './sort-errors';
35
35
'(click)' : '_sort.sort(this)' ,
36
36
'[class.mat-sort-header-sorted]' : '_isSorted()' ,
37
37
} ,
38
- encapsulation : ViewEncapsulation . None ,
39
- changeDetection : ChangeDetectionStrategy . OnPush ,
40
38
} )
41
39
export class MdSortHeader implements MdSortable {
42
40
/**
Original file line number Diff line number Diff line change @@ -233,17 +233,17 @@ class FakeDataSource extends DataSource<any> {
233
233
<cdk-table [dataSource]="dataSource" mdSort>
234
234
<ng-container cdkColumnDef="column_a">
235
235
<cdk-header-cell *cdkHeaderCellDef #sortHeaderA md-sort-header> Column A </cdk-header-cell>
236
- <cdk-cell *cdkCellDef="let row"> {{row.a}}</cdk-cell>
236
+ <cdk-cell *cdkCellDef="let row"> {{row.a}} </cdk-cell>
237
237
</ng-container>
238
238
239
239
<ng-container cdkColumnDef="column_b">
240
240
<cdk-header-cell *cdkHeaderCellDef #sortHeaderB md-sort-header> Column B </cdk-header-cell>
241
- <cdk-cell *cdkCellDef="let row"> {{row.b}}</cdk-cell>
241
+ <cdk-cell *cdkCellDef="let row"> {{row.b}} </cdk-cell>
242
242
</ng-container>
243
243
244
244
<ng-container cdkColumnDef="column_c">
245
245
<cdk-header-cell *cdkHeaderCellDef #sortHeaderC md-sort-header> Column C </cdk-header-cell>
246
- <cdk-cell *cdkCellDef="let row"> {{row.c}}</cdk-cell>
246
+ <cdk-cell *cdkCellDef="let row"> {{row.c}} </cdk-cell>
247
247
</ng-container>
248
248
249
249
<cdk-header-row *cdkHeaderRowDef="columnsToRender"></cdk-header-row>
You can’t perform that action at this time.
0 commit comments