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 @@ -217,14 +217,15 @@ export class CdkTable<T> implements CollectionViewer {
217217 ngAfterViewInit ( ) {
218218 // Find and construct an iterable differ that can be used to find the diff in an array.
219219 this . _dataDiffer = this . _differs . find ( [ ] ) . create ( this . _trackByFn ) ;
220-
221- this . _renderHeaderRow ( ) ;
222220 this . _isViewInitialized = true ;
223221 }
224222
225223 ngDoCheck ( ) {
226224 if ( this . _isViewInitialized && this . dataSource && ! this . _renderChangeSubscription ) {
227- this . _observeRenderChanges ( ) ;
225+ this . _renderHeaderRow ( ) ;
226+ if ( this . dataSource && ! this . _renderChangeSubscription ) {
227+ this . _observeRenderChanges ( ) ;
228+ }
228229 }
229230 }
230231
Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ import {getMdSortHeaderNotContainedWithinMdSortError} from './sort-errors';
3535 '(click)' : '_sort.sort(this)' ,
3636 '[class.mat-sort-header-sorted]' : '_isSorted()' ,
3737 } ,
38- encapsulation : ViewEncapsulation . None ,
39- changeDetection : ChangeDetectionStrategy . OnPush ,
4038} )
4139export class MdSortHeader implements MdSortable {
4240 /**
Original file line number Diff line number Diff line change @@ -233,17 +233,17 @@ class FakeDataSource extends DataSource<any> {
233233 <cdk-table [dataSource]="dataSource" mdSort>
234234 <ng-container cdkColumnDef="column_a">
235235 <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>
237237 </ng-container>
238238
239239 <ng-container cdkColumnDef="column_b">
240240 <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>
242242 </ng-container>
243243
244244 <ng-container cdkColumnDef="column_c">
245245 <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>
247247 </ng-container>
248248
249249 <cdk-header-row *cdkHeaderRowDef="columnsToRender"></cdk-header-row>
You can’t perform that action at this time.
0 commit comments