`[$喷油器:NOMOD]模块“谷歌 - 地图'不是available` [英] `[$injector:nomod] Module 'google-maps' is not available`

查看:230
本文介绍了`[$喷油器:NOMOD]模块“谷歌 - 地图'不是available`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用角谷歌,在地图的角度应用程序来处理谷歌地图。对于这一点,我必须在角谷歌-maps.js 添加到项目中。
该网页工作没有任何错误,如果我添加脚本以下列方式:

I'm using angular-google-maps to handle google maps at an angular application. For this, I have to add the angular-google-maps.jsto the project. The page works without any error, if I add the script in the following way:

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

但它不会工作,如果我使用本地副本,是这样的:

But it will not work, if I use the local copy, like this:

<script type="text/javascript" 
        src="js/libs/directiv.es/angular-google-maps.js"></script>

看着萤火虫,我看到了角谷歌-maps.js 文件被加载,但在这种情况下,会出现以下错误:

Looking at firebug, I see the angular-google-maps.js file is loaded, but in this case, the following error occurs:

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) 

在网上搜索小时,我没有找到任何原因或解决方案。也许你有一个想法或暗示,怎么找原因?

Searching the web for hours I did not find any reason or solution. Maybe you have an idea or hint, how to find the reason?

推荐答案

我找到了解决方案,并希望写下来,这里的情况下,有人运行到同样的问题。

I found the solution and like to write down that here for the case, the someone runs into the same problem.

在我而言,我从GitHub下载的角谷歌,地图扩展,提取在Windows上压缩文件的复制文件到我的项目。其结果,发生错误:因...无法实例化模块谷歌 - 地图而载入相同的JS通过HTTP文件的一切工作正常。问题的关键是:这不是同一个文件

In my case, I downloaded the angular-google-maps extension from github, extracted that zip-file on windows an copied the file to my project. With the result, that an error occurs: Failed to instantiate module google-maps due to ... while loading "the same" js file over http everything works fine. The point is: it's not the same file!

的解决方案是从URL链接和存储本地取该文件:

The solution is to take the file from the URL Link and storing local:

也许下载或提取过程中,zip文件被打破。也许有一个人品问题。无论

Maybe during downloading or extracting, the zip-file was broken. Maybe there is an character problem. Whatever.

如果我打开该链接<$c$c>http://www.directiv.es/application/html/js/nlaplante/angular-google-maps/angular-google-maps.js在浏览器中,我可以用鼠标右键单击该文件,并在源 - code编辑器中打开源并保存在磁盘上的该文件。

If I open that link http://www.directiv.es/application/html/js/nlaplante/angular-google-maps/angular-google-maps.js in an browser, I can right-click that file and open the source in an "source-code" editor and save that file on disk.

现在我可以在新创建的文件复制到我的项目文件夹一样,位置: JS /库/ directiv.es /角谷歌-maps.js 和一切正常精细.....

Now I can copy that new created file into my project folder like that location: js/libs/directiv.es/angular-google-maps.js and everything works fine.....

这篇关于`[$喷油器:NOMOD]模块“谷歌 - 地图'不是available`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆