Material Dialog gets stuck when called onClick of leaflet Marker Material Dialog gets stuck when called onClick of leaflet Marker angular angular

Material Dialog gets stuck when called onClick of leaflet Marker


The reason is that you're trigerring the opening of the modal outside of the "Angular World" because it is tied to a clickevent on a google map marker. Then you have these type of inconsistencies.

2 solutions :

  • Use agm-map lib that will angularify google map APIs
  • Keep using directly google map APIs but add NgZone to explicitely tell that you want to execute some code back inside the angular world :

m.addEventListener("click", ()=> { this.zone.run(() => {this.openExampleDialog();})})

Working fiddle here