<!-- GOOGLE MAP --> <script src="https://maps.googleapis.com/maps/api/js? key= &libraries=places &callback=initialize" async defer></script> <!-- cordova.js required for cordova apps (remove if not needed) --> <script src="cordova.js"></script>
The problem is that I don’t know how to handle the callback which is offered by the API mentioned at the end of the script URL,
if we delete the callback from the url, The map become unstable, sometime it works and sometime we had the famous error “google is not defined” and that because the initMap() in my home.ts and the loading of the Google Map API are not synchronized, so if the Google Maps Api loaded before the App calls initMap() it works correctly and vice versa.
So please how can I handle this callback with Angular 2+ to take off tiis instability ?