Revisiting previously working code with ionic2beta, now with ionic3.
I have this code pice, where mapObject is a Leaflet Marker object.
...
mapObject.controller = this; //assigns view controller to map object so that view controller would be available in onClick function
mapObject.onClick(function(){
//this is now the marker
this.controller._stationService.getStationData(this.name).subscribe(report =>{
//this is now not clearly defined. With ionic2 beta, it used to be the still the marker. Still works in Chrome but breaks in native iOS app
if(this.controller._stationService.checkReport(report)){
console.log(report);
});
});
});
Running ionic serve and testing with Chrome, this will remain the same mapObject
/ marker as in the outside scope that called getStationData.
Running the code as an App on iOS, in the inside scope this is a different object. It does not have the controller attribute anymore, hence the whole bracket fails.
Now, what really puzzles me is that it used to work before, still works in Chrome but fails in iOS…
What shall I try?