Skip to content

Commit 2da7c11

Browse files
crisbetojelbourn
authored andcommitted
refactor(paginator): remove extra exposed properties (#14809)
Makes the `_pageIndex` and `_length` properties private so they don't pollute the public API and because they already have public getters.
1 parent 3ddcd8d commit 2da7c11

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/lib/paginator/paginator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy
9393
this._pageIndex = Math.max(coerceNumberProperty(value), 0);
9494
this._changeDetectorRef.markForCheck();
9595
}
96-
_pageIndex: number = 0;
96+
private _pageIndex = 0;
9797

9898
/** The length of the total number of items that are being paginated. Defaulted to 0. */
9999
@Input()
@@ -102,7 +102,7 @@ export class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy
102102
this._length = coerceNumberProperty(value);
103103
this._changeDetectorRef.markForCheck();
104104
}
105-
_length: number = 0;
105+
private _length = 0;
106106

107107
/** Number of items to display on a page. By default set to 50. */
108108
@Input()

tools/public_api_guard/lib/paginator.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export declare function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl: MatPagin
1111
export declare class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy, CanDisable, HasInitialized {
1212
_displayedPageSizeOptions: number[];
1313
_intl: MatPaginatorIntl;
14-
_length: number;
15-
_pageIndex: number;
1614
color: ThemePalette;
1715
hidePageSize: boolean;
1816
length: number;

0 commit comments

Comments
 (0)