我刚刚将angular-leaflet-directive添加到我的项目中,当我使用Grunt构建它时,它现在失败了。该依赖项是使用bower添加的。这个项目是使用约曼角度生成器构建的。
这里我在我的app.js中包含了leaflet指令
angular
.module('statsApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute',
'leaflet-directive'
])现在,我只是在我的视图中有了<leaflet></leaflet>,只是为了让事情开始。
当Grunt构建失败时,我会收到以下错误消息
Error: [$injector:modulerr] Failed to instantiate module statsApp due to:
Error: [$injector:modulerr] Failed to instantiate module leaflet-directive due to:
Error: [$injector:nomod] Module 'leaflet-directive' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.发布于 2014-08-14 06:44:51
这篇文章解决了我的问题。它不是特定于我添加的模块,而是特定于Karma测试失败,因为他们不知道leaflet-directive模块。
https://stackoverflow.com/questions/25297326
复制相似问题