I am using jQuery UI slider in Angular and slider is initialized and being slide properly.however, when i call another function from change event then its not called and giving error as below :
TypeError: this.getSelected is not a function
HTML :
component.ts :
ngAfterViewInit(){
$("#rangeSlider1").slider({
range: true,
min: 0,
max: 333,
step: 10,
values: [0, 333],
change: function(event,ui){
this.getSelected(ui);
}
})
}
getSelected(){
// further actions need to execute on change of the slider.
}
Here, getSelected() is another function which i need to call when slider range is change, but this gives me an error as mentioned above. Please note, I can't put the whole code of getSelected function to slider initialization.
Thank you!