Angular google map close info window on new marker click
You can rewrite your clickedMarker
very simple as follows
previous;
...
clickedMarker(infowindow) {
if (this.previous) {
this.previous.close();
}
this.previous = infowindow;
}
Make the change to your event binding function in the template
(markerClick)="clickedMarker(infoWindow)"
The live code is here