From 2da7c11e222c17ed364b37e1e425991536f8490a Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 7 Feb 2019 20:53:59 +0100 Subject: [PATCH] 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. --- src/lib/paginator/paginator.ts | 4 ++-- tools/public_api_guard/lib/paginator.d.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/paginator/paginator.ts b/src/lib/paginator/paginator.ts index 0445dcd9f50..f63d06007db 100644 --- a/src/lib/paginator/paginator.ts +++ b/src/lib/paginator/paginator.ts @@ -93,7 +93,7 @@ export class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy this._pageIndex = Math.max(coerceNumberProperty(value), 0); this._changeDetectorRef.markForCheck(); } - _pageIndex: number = 0; + private _pageIndex = 0; /** The length of the total number of items that are being paginated. Defaulted to 0. */ @Input() @@ -102,7 +102,7 @@ export class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy this._length = coerceNumberProperty(value); this._changeDetectorRef.markForCheck(); } - _length: number = 0; + private _length = 0; /** Number of items to display on a page. By default set to 50. */ @Input() diff --git a/tools/public_api_guard/lib/paginator.d.ts b/tools/public_api_guard/lib/paginator.d.ts index b9e5fb4da3b..e2a23ef90ce 100644 --- a/tools/public_api_guard/lib/paginator.d.ts +++ b/tools/public_api_guard/lib/paginator.d.ts @@ -11,8 +11,6 @@ export declare function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl: MatPagin export declare class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy, CanDisable, HasInitialized { _displayedPageSizeOptions: number[]; _intl: MatPaginatorIntl; - _length: number; - _pageIndex: number; color: ThemePalette; hidePageSize: boolean; length: number;