I was trying to call a function inside a class function.
Like the following code. I want to call addMarks
in my init()
function.
But it threw this error
$.get(...).bind is not a function
class MapManager {
init(){
$('#search').click(function(event) {
if(start && destination){
$.get('routes/search', {data: 123}, function(data, textStatus, xhr) {
this.addMarks(data.data);
}).bind(this);
}
});
}
addMarks(locations){
...
}
}