Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/material/paginator/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import {
ChangeDetectorRef,
Component,
EventEmitter,
Inject,
InjectionToken,
Input,
OnDestroy,
OnInit,
Optional,
Output,
ViewEncapsulation,
booleanAttribute,
Expand Down Expand Up @@ -111,6 +109,9 @@ export const MAT_PAGINATOR_DEFAULT_OPTIONS = new InjectionToken<MatPaginatorDefa
imports: [MatFormField, MatSelect, MatOption, MatIconButton, MatTooltip],
})
export class MatPaginator implements OnInit, OnDestroy {
_intl = inject(MatPaginatorIntl);
private _changeDetectorRef = inject(ChangeDetectorRef);

/** If set, styles the "page size" form field with the designated style. */
_formFieldAppearance?: MatFormFieldAppearance;

Expand Down Expand Up @@ -198,11 +199,15 @@ export class MatPaginator implements OnInit, OnDestroy {
/** Emits when the paginator is initialized. */
initialized: Observable<void> = this._initializedStream;

constructor(
public _intl: MatPaginatorIntl,
private _changeDetectorRef: ChangeDetectorRef,
@Optional() @Inject(MAT_PAGINATOR_DEFAULT_OPTIONS) defaults?: MatPaginatorDefaultOptions,
) {
/** Inserted by Angular inject() migration for backwards compatibility */
constructor(...args: unknown[]);

constructor() {
const _intl = this._intl;
const defaults = inject<MatPaginatorDefaultOptions>(MAT_PAGINATOR_DEFAULT_OPTIONS, {
optional: true,
});

this._intlChanges = _intl.changes.subscribe(() => this._changeDetectorRef.markForCheck());

if (defaults) {
Expand Down
5 changes: 2 additions & 3 deletions tools/public_api_guard/material/paginator.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
```ts

import { ChangeDetectorRef } from '@angular/core';
import { EventEmitter } from '@angular/core';
import * as i0 from '@angular/core';
import * as i1 from '@angular/material/button';
Expand Down Expand Up @@ -34,7 +33,7 @@ export function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl: MatPaginatorIntl

// @public
export class MatPaginator implements OnInit, OnDestroy {
constructor(_intl: MatPaginatorIntl, _changeDetectorRef: ChangeDetectorRef, defaults?: MatPaginatorDefaultOptions);
constructor(...args: unknown[]);
protected _buttonClicked(targetIndex: number, isDisabled: boolean): void;
_changePageSize(pageSize: number): void;
color: ThemePalette;
Expand Down Expand Up @@ -85,7 +84,7 @@ export class MatPaginator implements OnInit, OnDestroy {
// (undocumented)
static ɵcmp: i0.ɵɵComponentDeclaration<MatPaginator, "mat-paginator", ["matPaginator"], { "color": { "alias": "color"; "required": false; }; "pageIndex": { "alias": "pageIndex"; "required": false; }; "length": { "alias": "length"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; }; "hidePageSize": { "alias": "hidePageSize"; "required": false; }; "showFirstLastButtons": { "alias": "showFirstLastButtons"; "required": false; }; "selectConfig": { "alias": "selectConfig"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "page": "page"; }, never, never, true, never>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatPaginator, [null, null, { optional: true; }]>;
static ɵfac: i0.ɵɵFactoryDeclaration<MatPaginator, never>;
}

// @public
Expand Down
Loading