@@ -88,32 +88,23 @@ export class MatList extends _MatListMixinBase implements CanDisableRipple, OnCh
88
88
/** Emits when the state of the list changes. */
89
89
_stateChanges = new Subject < void > ( ) ;
90
90
91
- /**
92
- * @deprecated _elementRef parameter to be made required.
93
- * @breaking -change 8.0.0
94
- */
95
- constructor ( private _elementRef ?: ElementRef < HTMLElement > ) {
91
+ constructor ( private _elementRef : ElementRef < HTMLElement > ) {
96
92
super ( ) ;
97
93
98
- if ( this . _getListType ( ) === 'action-list' && _elementRef ) {
94
+ if ( this . _getListType ( ) === 'action-list' ) {
99
95
_elementRef . nativeElement . classList . add ( 'mat-action-list' ) ;
100
96
}
101
97
}
102
98
103
99
_getListType ( ) : 'list' | 'action-list' | null {
104
- const elementRef = this . _elementRef ;
100
+ const nodeName = this . _elementRef . nativeElement . nodeName . toLowerCase ( ) ;
105
101
106
- // @breaking -change 8.0.0 Remove null check once _elementRef is a required param.
107
- if ( elementRef ) {
108
- const nodeName = elementRef . nativeElement . nodeName . toLowerCase ( ) ;
109
-
110
- if ( nodeName === 'mat-list' ) {
111
- return 'list' ;
112
- }
102
+ if ( nodeName === 'mat-list' ) {
103
+ return 'list' ;
104
+ }
113
105
114
- if ( nodeName === 'mat-action-list' ) {
115
- return 'action-list' ;
116
- }
106
+ if ( nodeName === 'mat-action-list' ) {
107
+ return 'action-list' ;
117
108
}
118
109
119
110
return null ;
@@ -185,10 +176,9 @@ export class MatListItem extends _MatListItemMixinBase implements AfterContentIn
185
176
@ContentChild ( MatListIconCssMatStyler , { static : false } ) _icon : MatListIconCssMatStyler ;
186
177
187
178
constructor ( private _element : ElementRef < HTMLElement > ,
179
+ _changeDetectorRef : ChangeDetectorRef ,
188
180
@Optional ( ) navList ?: MatNavList ,
189
- @Optional ( ) list ?: MatList ,
190
- // @breaking -change 8.0.0 `_changeDetectorRef` to be made into a required parameter.
191
- _changeDetectorRef ?: ChangeDetectorRef ) {
181
+ @Optional ( ) list ?: MatList ) {
192
182
super ( ) ;
193
183
this . _isInteractiveList = ! ! ( navList || ( list && list . _getListType ( ) === 'action-list' ) ) ;
194
184
this . _list = navList || list ;
@@ -201,8 +191,7 @@ export class MatListItem extends _MatListItemMixinBase implements AfterContentIn
201
191
element . setAttribute ( 'type' , 'button' ) ;
202
192
}
203
193
204
- // @breaking -change 8.0.0 Remove null check for _changeDetectorRef.
205
- if ( this . _list && _changeDetectorRef ) {
194
+ if ( this . _list ) {
206
195
// React to changes in the state of the parent list since
207
196
// some of the item's properties depend on it (e.g. `disableRipple`).
208
197
this . _list . _stateChanges . pipe ( takeUntil ( this . _destroyed ) ) . subscribe ( ( ) => {
0 commit comments