@@ -142,12 +142,8 @@ export class MatSortHeader extends _MatSortHeaderMixinBase
142
142
@Optional ( ) public _sort : MatSort ,
143
143
@Inject ( 'MAT_SORT_HEADER_COLUMN_DEF' ) @Optional ( )
144
144
public _columnDef : MatSortHeaderColumnDef ,
145
- /**
146
- * @deprecated _focusMonitor and _elementRef to become required parameters.
147
- * @breaking -change 10.0.0
148
- */
149
- private _focusMonitor ?: FocusMonitor ,
150
- private _elementRef ?: ElementRef < HTMLElement > ) {
145
+ private _focusMonitor : FocusMonitor ,
146
+ private _elementRef : ElementRef < HTMLElement > ) {
151
147
// Note that we use a string token for the `_columnDef`, because the value is provided both by
152
148
// `material/table` and `cdk/table` and we can't have the CDK depending on Material,
153
149
// and we want to avoid having the sort header depending on the CDK table because
@@ -173,12 +169,10 @@ export class MatSortHeader extends _MatSortHeaderMixinBase
173
169
changeDetectorRef . markForCheck ( ) ;
174
170
} ) ;
175
171
176
- if ( _focusMonitor && _elementRef ) {
177
- // We use the focus monitor because we also want to style
178
- // things differently based on the focus origin.
179
- _focusMonitor . monitor ( _elementRef , true )
180
- . subscribe ( origin => this . _setIndicatorHintVisible ( ! ! origin ) ) ;
181
- }
172
+ // We use the focus monitor because we also want to style
173
+ // things differently based on the focus origin.
174
+ _focusMonitor . monitor ( _elementRef , true )
175
+ . subscribe ( origin => this . _setIndicatorHintVisible ( ! ! origin ) ) ;
182
176
}
183
177
184
178
ngOnInit ( ) {
@@ -195,11 +189,7 @@ export class MatSortHeader extends _MatSortHeaderMixinBase
195
189
}
196
190
197
191
ngOnDestroy ( ) {
198
- // @breaking -change 10.0.0 Remove null check for _focusMonitor and _elementRef.
199
- if ( this . _focusMonitor && this . _elementRef ) {
200
- this . _focusMonitor . stopMonitoring ( this . _elementRef ) ;
201
- }
202
-
192
+ this . _focusMonitor . stopMonitoring ( this . _elementRef ) ;
203
193
this . _sort . deregister ( this ) ;
204
194
this . _rerenderSubscription . unsubscribe ( ) ;
205
195
}
0 commit comments