|
1 | 1 | import {ECalendarValue} from '../common/types/calendar-value-enum';
|
2 | 2 | import {
|
| 3 | + ChangeDetectionStrategy, ChangeDetectorRef, |
3 | 4 | Component,
|
4 | 5 | EventEmitter,
|
5 | 6 | forwardRef,
|
@@ -35,6 +36,7 @@ import {SingleCalendarValue} from '../common/types/single-calendar-value';
|
35 | 36 | templateUrl: 'month-calendar.component.html',
|
36 | 37 | styleUrls: ['month-calendar.component.less'],
|
37 | 38 | encapsulation: ViewEncapsulation.None,
|
| 39 | + changeDetection: ChangeDetectionStrategy.OnPush, |
38 | 40 | providers: [
|
39 | 41 | MonthCalendarService,
|
40 | 42 | {
|
@@ -103,8 +105,9 @@ export class MonthCalendarComponent implements OnInit, OnChanges, ControlValueAc
|
103 | 105 | return this._currentDateView;
|
104 | 106 | }
|
105 | 107 |
|
106 |
| - constructor(public monthCalendarService: MonthCalendarService, |
107 |
| - public utilsService: UtilsService) { |
| 108 | + constructor(public readonly monthCalendarService: MonthCalendarService, |
| 109 | + public readonly utilsService: UtilsService, |
| 110 | + public readonly cd: ChangeDetectorRef) { |
108 | 111 | }
|
109 | 112 |
|
110 | 113 | ngOnInit() {
|
@@ -152,6 +155,8 @@ export class MonthCalendarComponent implements OnInit, OnChanges, ControlValueAc
|
152 | 155 | .generateYear(this.componentConfig, this.currentDateView, this.selected);
|
153 | 156 | this.inputValueType = this.utilsService.getInputType(this.inputValue, this.componentConfig.allowMultiSelect);
|
154 | 157 | }
|
| 158 | + |
| 159 | + this.cd.markForCheck(); |
155 | 160 | }
|
156 | 161 |
|
157 | 162 | registerOnChange(fn: any): void {
|
|
0 commit comments