# Not able to call a method when a feature/marker is selected in OpenLayers

I am having a map with multiple ol/Feature markers.
When clicking on a marker some code should be executed.

The problem is that I get this error when trying to call a method when a clicked is performed: TypeError: this.methodCall is not a function at Select.

ngOnInit() {
.......
this.setMapInteraction();
}

setMapInteraction() {
var select = new Select({});
select.on('select', function (evt) {
var selectedString = evt.selected[0].getStyle()[1].getText().getText();
console.log(selectedString); //Selected string is printed fine.
this.methodCall();
});
}

methodCall() {
console.log("This is not printed");
//Some action I want to perform.
}


If someone knows how to solve this or can provide me another approach I would be very happy.

Source: New feed
Source Url Not able to call a method when a feature/marker is selected in OpenLayers