Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/416.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 `[$injector:nomod]模块';谷歌地图&x27;不可用`_Javascript_Angularjs_Google Maps_Angular Google Maps - Fatal编程技术网

Javascript `[$injector:nomod]模块';谷歌地图&x27;不可用`

Javascript `[$injector:nomod]模块';谷歌地图&x27;不可用`,javascript,angularjs,google-maps,angular-google-maps,Javascript,Angularjs,Google Maps,Angular Google Maps,我正在使用angular google maps在angular应用程序中处理google maps。为此,我必须向项目中添加angular google maps.js。 如果我按以下方式添加脚本,则该页面不会出现任何错误: <script type="text/javascript" src="http://www.directiv.es/application/html/js/nlaplante/angular-google-maps/angular-google-

我正在使用angular google maps在angular应用程序中处理google maps。为此,我必须向项目中添加
angular google maps.js
。 如果我按以下方式添加脚本,则该页面不会出现任何错误:

<script type="text/javascript" 
        src="http://www.directiv.es/application/html/js/nlaplante/angular-google-maps/angular-google-maps.js"></script>

在网上搜索了几个小时,我没有找到任何原因或解决办法。也许你有一个想法或提示,如何找到原因?

我找到了解决方案,并在这里写下,对于这个案例,某人遇到了相同的问题

在我的例子中,我从github下载了angular google maps扩展,在windows上提取了该zip文件,并将该文件复制到我的项目中。结果,出现了一个错误:
未能实例化模块google maps,因为…
在http上加载“相同”的js文件时一切正常。关键是:它不是同一个文件

解决方案是从URL链接获取文件并存储本地:

可能是在下载或解压缩时,zip文件被破坏了。也许是性格问题。不管怎样

如果我打开该链接
http://www.directiv.es/application/html/js/nlaplante/angular-google-maps/angular-google-maps.js
在浏览器中,我可以右键单击该文件,在“源代码”编辑器中打开源代码,并将该文件保存在磁盘上


现在我可以将新创建的文件复制到我的项目文件夹中,位置如下:
js/libs/directiv.es/angular google maps.js
,一切正常

我找到了解决方案,我想在这里写下,对于这个案例,某人遇到了同样的问题

在我的例子中,我从github下载了angular google maps扩展,在windows上提取了该zip文件,并将该文件复制到我的项目中。结果,出现了一个错误:
未能实例化模块google maps,因为…
在http上加载“相同”的js文件时一切正常。关键是:它不是同一个文件

解决方案是从URL链接获取文件并存储本地:

可能是在下载或解压缩时,zip文件被破坏了。也许是性格问题。不管怎样

如果我打开该链接
http://www.directiv.es/application/html/js/nlaplante/angular-google-maps/angular-google-maps.js
在浏览器中,我可以右键单击该文件,在“源代码”编辑器中打开源代码,并将该文件保存在磁盘上


现在我可以将新创建的文件复制到我的项目文件夹中,位置如下:
js/libs/directiv.es/angular google maps.js
,一切正常

在实例化angular模块之前,是否确保已加载angular-google-maps.js文件?在“引导”应用程序之前,我已尝试超时2秒。但是没有变化。实例化angular模块是在引导应用程序之后发生的,对吗?而且:从http加载
.js
文件应该比链接到本地版本慢得多。但是本地版本失败了。明白了吗?你用dot创建了文件夹“directiv.es”吗?因为您是以这种方式被包括进来的是的,文件夹是用点创建的!查看firebug,我发现
angular google maps.js
文件的加载没有任何问题。在实例化angular模块之前,您是否确保angular-google-maps.js文件已加载?在“引导”应用程序之前,我已尝试超时2秒。但是没有变化。实例化angular模块是在引导应用程序之后发生的,对吗?而且:从http加载
.js
文件应该比链接到本地版本慢得多。但是本地版本失败了。明白了吗?你用dot创建了文件夹“directiv.es”吗?因为您是以这种方式被包括进来的是的,文件夹是用点创建的!查看firebug,我发现
angular google maps.js
文件的加载没有任何问题。
<script type="text/javascript" 
        src="js/libs/directiv.es/angular-google-maps.js"></script>
Uncaught Error: [$injector:modulerr] Failed to instantiate module mapsApp due to:
Error: [$injector:modulerr] Failed to instantiate module google-maps due to:
Error: [$injector:nomod] Module 'google-maps' is not available! You either misspelled the...<omitted>...1)