Skip to content

Commit

Permalink
feat: on push strategy for date picker
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardmarcinco committed Dec 17, 2024
1 parent e16af1d commit ff51199
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/datepicker-input/datepicker-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
EventEmitter,
ElementRef,
TemplateRef,
ViewChild
ViewChild,
ChangeDetectionStrategy
} from "@angular/core";
import { NG_VALUE_ACCESSOR } from "@angular/forms";

Expand Down Expand Up @@ -124,7 +125,8 @@ import { NG_VALUE_ACCESSOR } from "@angular/forms";
useExisting: DatePickerInput,
multi: true
}
]
],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DatePickerInput {
private static datePickerCount = 0;
Expand Down
6 changes: 4 additions & 2 deletions src/datepicker/datepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
AfterViewInit,
ViewChild,
OnInit,
SimpleChange
SimpleChange,
ChangeDetectionStrategy
} from "@angular/core";
import rangePlugin from "flatpickr/dist/plugins/rangePlugin";
import flatpickr from "flatpickr";
Expand Down Expand Up @@ -120,7 +121,8 @@ if (languages.default?.default["en"]?.weekdays) {
multi: true
}
],
encapsulation: ViewEncapsulation.None
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DatePicker implements
OnInit,
Expand Down

0 comments on commit ff51199

Please sign in to comment.