[Solved] Use navController or other class in GoogleMaps object?


#1

How i can use methods of other classes in a google maps object?

example:
https://codeshare.io/axP81R

var markers = this.locations.map(function(location, info) {
var marker = new google.maps.Marker({
position: location,
label: labels[info % labels.length]
});

        google.maps.event.addListener(marker, 'click', function() {
						
          //here i want use something like this
          this.navController.push(PointPage);
          
        });
        return marker;
    });

There is the way to use the method of a Class in the object of another Class?


#2

You pretty much never want to type function in Ionic, instead you want to utilize fat arrows () =>.

So replace function() with () => and function(location, info) with (location, info) =>.


#3

i love you, seriously i love you …thanks man, I wasted 5 hours today to try to solve this problem