I have a click function on an OpenLayers map
testvar: string
map = new Map()
ngOnInit(): void {
this.map.on('click', function(event) {
console.log(this.testvar)
})
}
But this is not available within the scope of the click function.
Any ideas how to do this/
let that = this; console.log(that.testvar)not Sure but try like this.