Skip to content

refactor(material/datepicker): expose month view change detector ref #21048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
2 changes: 1 addition & 1 deletion src/material/datepicker/month-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class MatMonthView<D> implements AfterContentInit, OnChanges, OnDestroy {
/** The names of the weekdays. */
_weekdays: {long: string, narrow: string}[];

constructor(private _changeDetectorRef: ChangeDetectorRef,
constructor(readonly _changeDetectorRef: ChangeDetectorRef,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is fine, but what's the context behind it? Which other components need to access it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a Google internal datepicker spec based off this one. It's needed as part of implementing that.

@Optional() @Inject(MAT_DATE_FORMATS) private _dateFormats: MatDateFormats,
@Optional() public _dateAdapter: DateAdapter<D>,
@Optional() private _dir?: Directionality,
Expand Down
1 change: 1 addition & 0 deletions tools/public_api_guard/material/datepicker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ export declare class MatEndDate<D> extends _MatDateRangeInputBase<D> implements
}

export declare class MatMonthView<D> implements AfterContentInit, OnChanges, OnDestroy {
readonly _changeDetectorRef: ChangeDetectorRef;
_comparisonRangeEnd: number | null;
_comparisonRangeStart: number | null;
_dateAdapter: DateAdapter<D>;
Expand Down