We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
keeping map key in index.html not a good idea in live environment. Is there way can move the key from index.html to app.module.ts or environment.ts
The text was updated successfully, but these errors were encountered:
you may want to use an npm package such as 'load-script2' and implement a dynamic loader such as this:
import loadScript from 'load-script2'; let scriptPromise: Promise<any> | null = null; export const scriptLoader = (scriptSrc: string, attrs?: object, parentNode?: HTMLElement, apiExists?: (any) => boolean): Promise<any> => { // if(!scriptPromise) scriptPromise = new Promise((resolve, reject) => { if (apiExists && apiExists(window as any)) { console.log('scriptLoader:apiExists', scriptSrc); resolve((window as any)); } else { console.log('scriptLoader:loadScript', scriptSrc); loadScript(scriptSrc, attrs, parentNode) .then(() => { resolve((window as any)); }) .catch((err) => { reject(err); }); } }); return scriptPromise; };
you can pass in your Google maps api url (and the key can be stored basically any way you like): example:
scriptLoader( "YOUR SCRIPT HERE", ).then((win) => { // script loaded }).catch(e => { // something broke });
Sorry, something went wrong.
No branches or pull requests
keeping map key in index.html not a good idea in live environment.
Is there way can move the key from index.html to app.module.ts or environment.ts
The text was updated successfully, but these errors were encountered: