@@ -11,12 +11,10 @@ import {
1111 ChangeDetectorRef ,
1212 Component ,
1313 EventEmitter ,
14- Inject ,
1514 InjectionToken ,
1615 Input ,
1716 OnDestroy ,
1817 OnInit ,
19- Optional ,
2018 Output ,
2119 ViewEncapsulation ,
2220 booleanAttribute ,
@@ -111,6 +109,9 @@ export const MAT_PAGINATOR_DEFAULT_OPTIONS = new InjectionToken<MatPaginatorDefa
111109 imports : [ MatFormField , MatSelect , MatOption , MatIconButton , MatTooltip ] ,
112110} )
113111export class MatPaginator implements OnInit , OnDestroy {
112+ _intl = inject ( MatPaginatorIntl ) ;
113+ private _changeDetectorRef = inject ( ChangeDetectorRef ) ;
114+
114115 /** If set, styles the "page size" form field with the designated style. */
115116 _formFieldAppearance ?: MatFormFieldAppearance ;
116117
@@ -198,11 +199,15 @@ export class MatPaginator implements OnInit, OnDestroy {
198199 /** Emits when the paginator is initialized. */
199200 initialized : Observable < void > = this . _initializedStream ;
200201
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+
206211 this . _intlChanges = _intl . changes . subscribe ( ( ) => this . _changeDetectorRef . markForCheck ( ) ) ;
207212
208213 if ( defaults ) {
0 commit comments