添加angular-leaf -指令后构建失败

Grunt build failing after adding angular-leaflet-directive

本文关键字:构建 失败 指令 angular-leaf 添加      更新时间:2023-09-26

我刚刚将angular-leaf -directive添加到我的项目中,当我用Grunt构建它时,它现在失败了。该依赖是使用bower添加的。这个项目是使用约曼角生成器构建的。

我在app.js中加入了leaf -指令

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.

这篇文章解决了我的问题。它不是特定于我要添加的模块,而是特定于Karma测试失败,因为它们不知道leaflet-directive模块。

AngularJS错误:Module ngAnimate is not available