This worked perfectly.
Mariano Conti
1

Marker is a google maps class, so addListener isn’t the typical DOM implementation. As such, it returns, like you said, a weird object instead of the Marker object.

You can take advantage of closures here and do something like

var self = this;
function addClickListener(marker) {
marker.addListener(‘click’, () => {
self.zone.run(() => {
self.showDetails(marker)
});
});
}

The storal of the mory, though, is that the Marker object isn’t a typical DOM node, and as such it’s addListener doesn’t abide by the same specs.

Show your support

Clapping shows how much you appreciated Pete Mertz’s story.