you added the script tag at the end of your app?
i think maps is not loaded when you access it.
Check if google maps is loaded at all --> open JS Console and check if there is a google key on your window object, after the page is fully loaded.
If so i think it is a timing issue.
I often use “ScriptLoaderComponents/Directives” to do those stuff.
Like --> GoogleMapsLoader, checks if google and google.maps is already on the window object, if not --> add the async scripttag with your api key.
Add a google maps callback which triggers an event or somethingelse so you get notified, if google is or is already is initialised.
No hacky index.html manipulating.