I added the JQuery-UI MonthPicker to my Angular 6 application.
I want to trigger an Angular action when my date changes:
ngOnInit() {
$(document).ready(function() {
$('#myMonthPicker').MonthPicker(
{
Button: false,
MaxMonth: -1,
MonthFormat: 'MM yy'
OnAfterChooseMonth: this.update()
}
);
});
}
update() {
alert('works');
}
The update method is never hit.
And I have the following error:
TypeError: this.update is not a function
How could I call an Angular method from my JQuery-UI code ?