Skip to content

Commit a3f4f43

Browse files
authored
fix(table): use default change detection strategy on table [from #15440] (#15456)
1 parent 641e676 commit a3f4f43

File tree

4 files changed

+4
-27
lines changed

4 files changed

+4
-27
lines changed

src/cdk/table/row.ts

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

9-
import {
10-
ChangeDetectionStrategy,
11-
Component,
12-
Directive,
13-
IterableChanges,
14-
IterableDiffer,
15-
IterableDiffers,
16-
OnChanges,
17-
OnDestroy,
18-
SimpleChanges,
19-
TemplateRef,
20-
ViewContainerRef,
21-
ViewEncapsulation,
22-
} from '@angular/core';
23-
import {CanStick, CanStickCtor, mixinHasStickyInput} from './can-stick';
24-
import {CdkCellDef, CdkColumnDef} from './cell';
9+
import { Component, Directive, IterableChanges, IterableDiffer, IterableDiffers, OnChanges, OnDestroy, SimpleChanges, TemplateRef, ViewContainerRef, ViewEncapsulation } from '@angular/core';
10+
import { CanStick, CanStickCtor, mixinHasStickyInput } from './can-stick';
11+
import { CdkCellDef, CdkColumnDef } from './cell';
2512

2613
/**
2714
* The row template that can be used by the mat-table. Should not be used outside of the
@@ -248,7 +235,6 @@ export class CdkCellOutlet implements OnDestroy {
248235
'class': 'cdk-header-row',
249236
'role': 'row',
250237
},
251-
changeDetection: ChangeDetectionStrategy.OnPush,
252238
encapsulation: ViewEncapsulation.None,
253239
})
254240
export class CdkHeaderRow { }
@@ -263,7 +249,6 @@ export class CdkHeaderRow { }
263249
'class': 'cdk-footer-row',
264250
'role': 'row',
265251
},
266-
changeDetection: ChangeDetectionStrategy.OnPush,
267252
encapsulation: ViewEncapsulation.None,
268253
})
269254
export class CdkFooterRow { }
@@ -277,7 +262,6 @@ export class CdkFooterRow { }
277262
'class': 'cdk-row',
278263
'role': 'row',
279264
},
280-
changeDetection: ChangeDetectionStrategy.OnPush,
281265
encapsulation: ViewEncapsulation.None,
282266
})
283267
export class CdkRow { }

src/cdk/table/table.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {CollectionViewer, DataSource} from '@angular/cdk/collections';
1010
import {
1111
AfterContentChecked,
1212
Attribute,
13-
ChangeDetectionStrategy,
1413
ChangeDetectorRef,
1514
Component,
1615
ContentChildren,
@@ -158,7 +157,6 @@ export interface RenderRow<T> {
158157
'class': 'cdk-table',
159158
},
160159
encapsulation: ViewEncapsulation.None,
161-
changeDetection: ChangeDetectionStrategy.OnPush,
162160
})
163161
export class CdkTable<T> implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {
164162
private _document: Document;

src/lib/table/row.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import {
10-
ChangeDetectionStrategy,
1110
Component,
1211
Directive,
1312
ViewEncapsulation
@@ -63,7 +62,6 @@ export class MatRowDef<T> extends CdkRowDef<T> {}
6362
'class': 'mat-header-row',
6463
'role': 'row',
6564
},
66-
changeDetection: ChangeDetectionStrategy.OnPush,
6765
encapsulation: ViewEncapsulation.None,
6866
exportAs: 'matHeaderRow',
6967
providers: [{provide: CdkHeaderRow, useExisting: MatHeaderRow}],
@@ -79,7 +77,6 @@ export class MatHeaderRow extends CdkHeaderRow { }
7977
'class': 'mat-footer-row',
8078
'role': 'row',
8179
},
82-
changeDetection: ChangeDetectionStrategy.OnPush,
8380
encapsulation: ViewEncapsulation.None,
8481
exportAs: 'matFooterRow',
8582
providers: [{provide: CdkFooterRow, useExisting: MatFooterRow}],
@@ -95,7 +92,6 @@ export class MatFooterRow extends CdkFooterRow { }
9592
'class': 'mat-row',
9693
'role': 'row',
9794
},
98-
changeDetection: ChangeDetectionStrategy.OnPush,
9995
encapsulation: ViewEncapsulation.None,
10096
exportAs: 'matRow',
10197
providers: [{provide: CdkRow, useExisting: MatRow}],

src/lib/table/table.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {CDK_TABLE_TEMPLATE, CdkTable} from '@angular/cdk/table';
10-
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
10+
import {Component, ViewEncapsulation} from '@angular/core';
1111

1212
/**
1313
* Wrapper for the CdkTable with Material design styles.
@@ -22,7 +22,6 @@ import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/co
2222
'class': 'mat-table',
2323
},
2424
encapsulation: ViewEncapsulation.None,
25-
changeDetection: ChangeDetectionStrategy.OnPush,
2625
})
2726
export class MatTable<T> extends CdkTable<T> {
2827
/** Overrides the sticky CSS class set by the `CdkTable`. */

0 commit comments

Comments
 (0)