Skip to content

Commit 4d3919b

Browse files
crisbetommalerba
authored andcommitted
chore(list): switch to OnPush change detection (#5520)
Switches the `md-list` and `md-list-item` to `OnPush` change detection. Relates to #5035.
1 parent b3957d8 commit 4d3919b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/lib/list/list.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import {
1717
Optional,
1818
QueryList,
1919
Renderer2,
20-
ViewEncapsulation
20+
ViewEncapsulation,
21+
ChangeDetectionStrategy,
2122
} from '@angular/core';
2223
import {coerceBooleanProperty, MdLine, MdLineSetter} from '../core';
2324

@@ -36,7 +37,8 @@ export class MdListDivider {}
3637
host: {'role': 'list'},
3738
template: '<ng-content></ng-content>',
3839
styleUrls: ['list.css'],
39-
encapsulation: ViewEncapsulation.None
40+
encapsulation: ViewEncapsulation.None,
41+
changeDetection: ChangeDetectionStrategy.OnPush,
4042
})
4143
export class MdList {
4244
private _disableRipple: boolean = false;
@@ -120,7 +122,8 @@ export class MdListSubheaderCssMatStyler {}
120122
'(blur)': '_handleBlur()',
121123
},
122124
templateUrl: 'list-item.html',
123-
encapsulation: ViewEncapsulation.None
125+
encapsulation: ViewEncapsulation.None,
126+
changeDetection: ChangeDetectionStrategy.OnPush,
124127
})
125128
export class MdListItem implements AfterContentInit {
126129
private _lineSetter: MdLineSetter;

0 commit comments

Comments
 (0)