@@ -11,12 +11,10 @@ import {
11
11
ChangeDetectorRef ,
12
12
Component ,
13
13
EventEmitter ,
14
- Inject ,
15
14
InjectionToken ,
16
15
Input ,
17
16
OnDestroy ,
18
17
OnInit ,
19
- Optional ,
20
18
Output ,
21
19
ViewEncapsulation ,
22
20
booleanAttribute ,
@@ -111,6 +109,9 @@ export const MAT_PAGINATOR_DEFAULT_OPTIONS = new InjectionToken<MatPaginatorDefa
111
109
imports : [ MatFormField , MatSelect , MatOption , MatIconButton , MatTooltip ] ,
112
110
} )
113
111
export class MatPaginator implements OnInit , OnDestroy {
112
+ _intl = inject ( MatPaginatorIntl ) ;
113
+ private _changeDetectorRef = inject ( ChangeDetectorRef ) ;
114
+
114
115
/** If set, styles the "page size" form field with the designated style. */
115
116
_formFieldAppearance ?: MatFormFieldAppearance ;
116
117
@@ -198,11 +199,15 @@ export class MatPaginator implements OnInit, OnDestroy {
198
199
/** Emits when the paginator is initialized. */
199
200
initialized : Observable < void > = this . _initializedStream ;
200
201
201
- constructor (
202
- public _intl : MatPaginatorIntl ,
203
- private _changeDetectorRef : ChangeDetectorRef ,
204
- @Optional ( ) @Inject ( MAT_PAGINATOR_DEFAULT_OPTIONS ) defaults ?: MatPaginatorDefaultOptions ,
205
- ) {
202
+ /** Inserted by Angular inject() migration for backwards compatibility */
203
+ constructor ( ...args : unknown [ ] ) ;
204
+
205
+ constructor ( ) {
206
+ const _intl = this . _intl ;
207
+ const defaults = inject < MatPaginatorDefaultOptions > ( MAT_PAGINATOR_DEFAULT_OPTIONS , {
208
+ optional : true ,
209
+ } ) ;
210
+
206
211
this . _intlChanges = _intl . changes . subscribe ( ( ) => this . _changeDetectorRef . markForCheck ( ) ) ;
207
212
208
213
if ( defaults ) {
0 commit comments