Skip to content

Commit daf37d6

Browse files
committed
Created calendarView extension for material calender
1 parent 54f0b77 commit daf37d6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/cdk/datepicker/calendar-view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ export abstract class CalendarView<D> {
3232
/**
3333
* Emits whenever there is a state change that needs to be responded to.
3434
*/
35-
stateChanges = new Subject<D>();
35+
changes = new Subject<D>();
3636
}

src/lib/datepicker/calendar.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
ViewChild,
2626
ViewEncapsulation,
2727
} from '@angular/core';
28+
import {CalendarView} from '@angular/cdk/datepicker';
2829
import {DateAdapter, MAT_DATE_FORMATS, MatDateFormats} from '@angular/material/core';
2930
import {Subject, Subscription} from 'rxjs';
3031
import {createMissingDateImplError} from './datepicker-errors';
@@ -169,7 +170,7 @@ export class MatCalendarHeader<D> {
169170
encapsulation: ViewEncapsulation.None,
170171
changeDetection: ChangeDetectionStrategy.OnPush,
171172
})
172-
export class MatCalendar<D> implements AfterContentInit, AfterViewChecked, OnDestroy, OnChanges {
173+
export class MatCalendar<D> extends CalendarView<D> implements AfterContentInit, AfterViewChecked, OnDestroy, OnChanges {
173174
/** An input indicating the type of the header component, if set. */
174175
@Input() headerComponent: ComponentType<any>;
175176

@@ -278,6 +279,7 @@ export class MatCalendar<D> implements AfterContentInit, AfterViewChecked, OnDes
278279
@Optional() private _dateAdapter: DateAdapter<D>,
279280
@Optional() @Inject(MAT_DATE_FORMATS) private _dateFormats: MatDateFormats,
280281
changeDetectorRef: ChangeDetectorRef) {
282+
super();
281283

282284
if (!this._dateAdapter) {
283285
throw createMissingDateImplError('DateAdapter');

0 commit comments

Comments
 (0)