Angular router warning - did you forget to call ngZone.run()

311 Views Asked by At

I am getting this error every time i am trying to redirect to a link in the same application from google map. I am using agmmap and angular 8. Here is the sample code

<agm-map <some configuration there>>
  <agm-marker <some configuration there>>
    <agm-snazzy-info-window <some configuration there> #infoWindow>
      <ng-template>
        <a routerLink="/details">{{'view_details' | translate}}</a>
        </ng-template>
    </agm-snazzy-info-window>
  </agm-marker>
</agm-map>

I am able to fix that issue using this Tutorial, but i wanted to know like what is the root cause of it and is there any change / refactoring required in the code to resolve it? Screenshot

1

There are 1 best solutions below

0
On

This error asks you to call ngZone.run().

Since your error occurred every time you wanted to redirect to the same application google map you should call ngZone.run() after grantOfflineAccess().

grantOfflineAccess will be called when the user grants the requested scope (according to link)

I recommend you to read the error messages probably, this will lead you to fix 90% of the issues