title: How could I call a Angular2 function from a Google Map infowindow?
body: <p>Google map is integrated the javascript way and I want to call a angular2 function inside an infowindow like the following code. Take a look at <code>infoContent</code> for the button.</p>
  
  <pre><code>for (i = 0; i &lt; locations.length; i++) {
  
    let locLatLng = new google.maps.LatLng(locations[i].latitude, locations[i].longitude);
    let infoContent = '&lt;button (click)="myFunction(' + locations[i].id + ')"&gt;Details ...&lt;/button&gt;';
  
    marker = new google.maps.Marker({
      position: locLatLng,
      map: this.map
    });
  
    google.maps.event.addListener(marker, 'click', (function(marker, i) {
      return function() {
        infowindow.setContent(infoContent);
        infowindow.open(this.map, marker);
      };
    })(marker, i));
  
  }
  </code></pre>
  
  <p>Unfortunately the angular click event <code>(click)="myFunction()"</code> can't do it. There must be an other way. I would be very pleased if someone can point me to the right direction. Thanks in advance.</p>