Skip to content

Commit 936f114

Browse files
committed
fix(multiple): use eager change detection
Changes all the usages of `ChangeDetectionStrategy.Default` to use `Eager` instead.
1 parent 4b2d5b1 commit 936f114

17 files changed

Lines changed: 21 additions & 21 deletions

File tree

src/cdk/dialog/dialog-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function throwDialogContentAlreadyAttachedError() {
5757
encapsulation: ViewEncapsulation.None,
5858
// Using OnPush for dialogs caused some G3 sync issues. Disabled until we can track them down.
5959
// tslint:disable-next-line:validate-decorators
60-
changeDetection: ChangeDetectionStrategy.Default,
60+
changeDetection: ChangeDetectionStrategy.Eager,
6161
imports: [CdkPortalOutlet],
6262
host: {
6363
'class': 'cdk-dialog-container',

src/cdk/table/row.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export class CdkCellOutlet implements OnDestroy {
321321
},
322322
// See note on CdkTable for explanation on why this uses the default change detection strategy.
323323
// tslint:disable-next-line:validate-decorators
324-
changeDetection: ChangeDetectionStrategy.Default,
324+
changeDetection: ChangeDetectionStrategy.Eager,
325325
encapsulation: ViewEncapsulation.None,
326326
imports: [CdkCellOutlet],
327327
})
@@ -337,7 +337,7 @@ export class CdkHeaderRow {}
337337
},
338338
// See note on CdkTable for explanation on why this uses the default change detection strategy.
339339
// tslint:disable-next-line:validate-decorators
340-
changeDetection: ChangeDetectionStrategy.Default,
340+
changeDetection: ChangeDetectionStrategy.Eager,
341341
encapsulation: ViewEncapsulation.None,
342342
imports: [CdkCellOutlet],
343343
})
@@ -353,7 +353,7 @@ export class CdkFooterRow {}
353353
},
354354
// See note on CdkTable for explanation on why this uses the default change detection strategy.
355355
// tslint:disable-next-line:validate-decorators
356-
changeDetection: ChangeDetectionStrategy.Default,
356+
changeDetection: ChangeDetectionStrategy.Eager,
357357
encapsulation: ViewEncapsulation.None,
358358
imports: [CdkCellOutlet],
359359
})

src/cdk/table/table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export interface RenderRow<T> {
275275
// The view for `MatTable` consists entirely of templates declared in other views. As they are
276276
// declared elsewhere, they are checked when their declaration points are checked.
277277
// tslint:disable-next-line:validate-decorators
278-
changeDetection: ChangeDetectionStrategy.Default,
278+
changeDetection: ChangeDetectionStrategy.Eager,
279279
providers: [
280280
{provide: CDK_TABLE, useExisting: CdkTable},
281281
// Prevent nested tables from seeing this table's StickyPositioningListener.

src/cdk/table/text-column.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import {TEXT_COLUMN_OPTIONS, TextColumnOptions} from './tokens';
5252
// mean's the template in the table's view will not have the updated value (and in fact will cause
5353
// an ExpressionChangedAfterItHasBeenCheckedError).
5454
// tslint:disable-next-line:validate-decorators
55-
changeDetection: ChangeDetectionStrategy.Default,
55+
changeDetection: ChangeDetectionStrategy.Eager,
5656
imports: [CdkColumnDef, CdkHeaderCellDef, CdkHeaderCell, CdkCellDef, CdkCell],
5757
})
5858
export class CdkTextColumn<T> implements OnDestroy, OnInit {

src/cdk/tree/tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ type RenderingData<T> =
112112
// The view for `CdkTree` consists entirely of templates declared in other views. As they are
113113
// declared elsewhere, they are checked when their declaration points are checked.
114114
// tslint:disable-next-line:validate-decorators
115-
changeDetection: ChangeDetectionStrategy.Default,
115+
changeDetection: ChangeDetectionStrategy.Eager,
116116
imports: [CdkTreeNodeOutlet],
117117
})
118118
export class CdkTree<T, K = T>

src/material/bottom-sheet/bottom-sheet-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const EXIT_ANIMATION = '_mat-bottom-sheet-exit';
3535
// they were stamped out. This means that we can't have the bottom sheet container be OnPush,
3636
// because it might cause the sheets that were opened from a template not to be out of date.
3737
// tslint:disable-next-line:validate-decorators
38-
changeDetection: ChangeDetectionStrategy.Default,
38+
changeDetection: ChangeDetectionStrategy.Eager,
3939
encapsulation: ViewEncapsulation.None,
4040
host: {
4141
'class': 'mat-bottom-sheet-container',

src/material/dialog/dialog-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const CLOSE_ANIMATION_DURATION = 75;
4848
encapsulation: ViewEncapsulation.None,
4949
// Disabled for consistency with the non-MDC dialog container.
5050
// tslint:disable-next-line:validate-decorators
51-
changeDetection: ChangeDetectionStrategy.Default,
51+
changeDetection: ChangeDetectionStrategy.Eager,
5252
imports: [CdkPortalOutlet],
5353
host: {
5454
'class': 'mat-mdc-dialog-container mdc-dialog',

src/material/snack-bar/snack-bar-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const EXIT_ANIMATION = '_mat-snack-bar-exit';
5151
// where they were stamped out. This means that we can't have the snack bar container be OnPush,
5252
// because it might cause snack bars that were opened from a template not to be out of date.
5353
// tslint:disable-next-line:validate-decorators
54-
changeDetection: ChangeDetectionStrategy.Default,
54+
changeDetection: ChangeDetectionStrategy.Eager,
5555
encapsulation: ViewEncapsulation.None,
5656
imports: [CdkPortalOutlet],
5757
host: {

src/material/table/row.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class MatRowDef<T> extends CdkRowDef<T> {}
8080
},
8181
// See note on CdkTable for explanation on why this uses the default change detection strategy.
8282
// tslint:disable-next-line:validate-decorators
83-
changeDetection: ChangeDetectionStrategy.Default,
83+
changeDetection: ChangeDetectionStrategy.Eager,
8484
encapsulation: ViewEncapsulation.None,
8585
exportAs: 'matHeaderRow',
8686
providers: [{provide: CdkHeaderRow, useExisting: MatHeaderRow}],
@@ -98,7 +98,7 @@ export class MatHeaderRow extends CdkHeaderRow {}
9898
},
9999
// See note on CdkTable for explanation on why this uses the default change detection strategy.
100100
// tslint:disable-next-line:validate-decorators
101-
changeDetection: ChangeDetectionStrategy.Default,
101+
changeDetection: ChangeDetectionStrategy.Eager,
102102
encapsulation: ViewEncapsulation.None,
103103
exportAs: 'matFooterRow',
104104
providers: [{provide: CdkFooterRow, useExisting: MatFooterRow}],
@@ -116,7 +116,7 @@ export class MatFooterRow extends CdkFooterRow {}
116116
},
117117
// See note on CdkTable for explanation on why this uses the default change detection strategy.
118118
// tslint:disable-next-line:validate-decorators
119-
changeDetection: ChangeDetectionStrategy.Default,
119+
changeDetection: ChangeDetectionStrategy.Eager,
120120
encapsulation: ViewEncapsulation.None,
121121
exportAs: 'matRow',
122122
providers: [{provide: CdkRow, useExisting: MatRow}],

src/material/table/table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class MatRecycleRows {}
7777
encapsulation: ViewEncapsulation.None,
7878
// See note on CdkTable for explanation on why this uses the default change detection strategy.
7979
// tslint:disable-next-line:validate-decorators
80-
changeDetection: ChangeDetectionStrategy.Default,
80+
changeDetection: ChangeDetectionStrategy.Eager,
8181
imports: [HeaderRowOutlet, DataRowOutlet, NoDataRowOutlet, FooterRowOutlet],
8282
})
8383
export class MatTable<T> extends CdkTable<T> {

0 commit comments

Comments
 (0)