Posted 29 January 2018, 9:28 pm EST
Hello,
I have tried next code, but this only works if I click on datepicker. Do you have some other suggestion? Why does initialized event is not triggered by Angular?
<wj-input-date #openedOn
(initialized)="setIcon(openedOn,$event)">
// a method in controller
setIcon(s: wjcInput.InputDate, e: wjcCore.EventArgs) {
this.commonService.changeDatePickerIcon(s, e);
}
// method in the service
changeDatePickerIcon(s: any, e: any) {
s.calendar.formatItem.addHandler((sender: any, args: any) => {
if (s.hostElement.querySelector('.wj-glyph-down')) {
s.hostElement.querySelector('.wj-glyph-down').classList.add('fa');
s.hostElement.querySelector('.wj-glyph-down').classList.add('fa-calendar');
s.hostElement.querySelector('.wj-glyph-down').classList.remove('wj-glyph-down');
}
});
}
Thank you,
M