title: need to access child infoWindow of google maps marker in angular 5
body: <p>I have an Angular 5 app that uses Angular Google Maps(AGM) <a href="https://angular-maps.com/" rel="nofollow noreferrer">https://angular-maps.com/</a>. I have code where if you click on an item in a list from one component it opens a child infoWindow of a specific marker in a separate map component. I do this by changing the attribute isOpen in the infoWindow component. I want to be able to close any opened infoWindows when a new infoWindow is opened. I can't figure out how to get the instance of the child infoWindow associated with a specific marker. </p>
  
  <p>This is the map component HTML:</p>
  
  <pre><code>&lt;agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom"&gt;
      &lt;agm-marker id="{{ m.id }}" *ngFor="let m of markers; let i = index"
      [latitude]="m.latitude" [longitude]="m.longitude"
      [markerDraggable]="false" [iconUrl]="iconMarker" [openInfoWindow]="true"&gt;
        &lt;agm-info-window [disableAutoPan]="false" [isOpen]="m.isOpen"&gt;
          &lt;strong&gt;{{ m.name }}&lt;br&gt;
          {{ m.address }}&lt;br&gt;
          {{ m.city }}, {{ m.state }} {{ m.zipcode }}
        &lt;/agm-info-window&gt;
      &lt;/agm-marker&gt;
      &lt;mapcontent (onMapLoad)='loadAPIWrapper($event)'&gt;&lt;/mapcontent&gt;
    &lt;/agm-map&gt; 
  </code></pre>
  
  <p>This is the map component:</p>
  
  <pre><code>ngOnInit() {
      this.markersService.currentMarker.subscribe(
        (marker: Object) =&gt; {
          this.currentMarker = marker;
          this.isOpen = false;
          if ( this.currentMarker &amp;&amp; this._map ) {
            this.markerZoom();
          }
      });
  }
  public loadAPIWrapper(map) {
          this._map = map;
        }
  public markerZoom(){
          this.currentMarker.isOpen = true;
          const latlng = &lt;LatLngLiteral&gt;{
            lat: this.currentMarker.latitude, lng: this.currentMarker.longitude
          };
          this._map.setCenter( latlng );
          this._map.setZoom(9);
  
        }
  </code></pre>