I'm trying to figure out how to have a jquery function call a method in the enclosing Angular 2 Component.
I'm using the https://github.com/mdehoog/Semantic-UI-Calendar component in my Angular 2 project. I've declared a const of type any for jQuery, and then in my ngOnInit I do this:
jQuery('#monthYearPicker').calendar({
type: 'month',
maxDate: new Date(),
// minDate and maxDate take new Date() objects
onChange: function(date, text, mode) {
console.log("Date is " + date);
console.log("Text is " + text);
}
});
I'm seeing the console log as expected. What I don't get now is how do I then call back into my component so that I can do 'normal' stuff at this point? For example, I now want to call my method that queries a webservice and pass in the date that was selected.