Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在angular中使用index.html文件中的动态google map api键?_Javascript_Html_Angular_Google Maps_Google Maps Api 3 - Fatal编程技术网

Javascript 如何在angular中使用index.html文件中的动态google map api键?

Javascript 如何在angular中使用index.html文件中的动态google map api键?,javascript,html,angular,google-maps,google-maps-api-3,Javascript,Html,Angular,Google Maps,Google Maps Api 3,我在我的angular应用程序中使用谷歌地图。为此,我通过以下代码使用我的google map api密钥: 1) //index.html <head> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=geometry,drawing,visualization,places&key=GOOGLE_API_KEY" async

我在我的angular应用程序中使用谷歌地图。为此,我通过以下代码使用我的google map api密钥:

1) //index.html

<head>
<script type="text/javascript"
    src="https://maps.googleapis.com/maps/api/js?libraries=geometry,drawing,visualization,places&key=GOOGLE_API_KEY"
    async defer></script>
</head>
1)//index.html
但是现在我的要求改变了。现在我想从数据库中获取GoogleMapsAPI密钥。 我尝试了各种方法,但没有得到任何解决办法。有什么办法可以实现吗


谢谢。

哪个数据库?请注意,无论您从何处获取密钥,您的密钥都将对公众可见,但只要您使用适当的HTTP引用限制对其进行限制,它将是安全的。请看,我正在使用基于JWT令牌的API,并且我正在通过正确的身份验证从该API获取映射密钥。只是我需要在我的web项目中使用该键哪个数据库?请注意,无论您从何处获取密钥,您的密钥都将对公众可见,但只要您使用适当的HTTP引用限制对其进行限制,它将是安全的。请看,我正在使用基于JWT令牌的API,并且我正在通过正确的身份验证从该API获取映射密钥。只是我需要在我的web项目中使用该键