-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Maps API loaded multiple times when using Hot Module Reloading #775
Comments
This function should have a check if API is already loaded. There is the same issue when script tag was added manually for any other purpose. |
I think maintaining the injector state is not enough in this situation. So we can do better by checking the page. |
I have the same issue with lazy loading. When jump from one module to another it starts raising this issue. I have no idea how it works but maybe @SkipSelf need to be added when loading api in service? |
Are there any workarounds for this at the moment? |
same issue. Is there a snippet of code which could clarify how to fix this? Thanks |
Same here ! you need to check if google api is already loaded maybe with window.google ? |
In case of Lazy Loading look for solution here - #315 |
Anyhow, has anyone ever encountered any problem with this? This error is only raised during development, but it doesn't break anything. It's a nuisance, but it's safe to ignore. |
any news about it? same problema here with HMR |
Issue description
Using HMR, assets are reloaded in place. I get the following error in my console
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
Steps to reproduce and a minimal demo of the problem
Use angular2-google-maps in a component that is reloaded by HMR.
Current behavior
Reloads the Google Maps API on hot reload
Expected/desired behavior
Keep the old unchanged API instead
angular2 & angular2-google-maps version
Angular2: 2.2.0
A2GM: 0.16.0
The text was updated successfully, but these errors were encountered: