AngularJS错误:ngAnimate模块不可用

用户名

我是新来的有角度的人,遇到了问题。我使用了yeoman角度生成器,并添加了ngAnimate模块。当我运行时grunt test,出现以下错误:

Error: [$injector:modulerr] Failed to instantiate module portfolioApp due to:
Error: [$injector:modulerr] Failed to instantiate module ngAnimate due to:
Error: [$injector:nomod] Module 'ngAnimate' 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.

app.js

'use strict';

angular.module('portfolioApp', [
   'ngAnimate',
   'ngCookies',
   'ngResource',
   'ngSanitize',
   'ngRoute'
])

index.html

<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>

    <!-- build:js scripts/modules.js -->
    <script src="bower_components/angular-animate/angular-animate.js"></script>
    <script src="bower_components/angular-resource/angular-resource.js"></script>
    <script src="bower_components/angular-cookies/angular-cookies.js"></script>
    <script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
    <script src="bower_components/angular-route/angular-route.js"></script>

bower.json

{
  "name": "portfolio",
  "version": "0.0.0",
  "dependencies": {
    "angular": "1.2.0",
    "json3": "~3.2.4",
    "es5-shim": "~2.1.0",
    "jquery": "~1.10.2",
    "greensock": "~1.11.2",
    "angular-animate": "1.2.0",
    "angular-resource": "1.2.0",
    "angular-cookies": "1.2.0",
    "angular-sanitize": "1.2.0",
    "angular-route": "1.2.0"
  },
  "devDependencies": {
    "angular-mocks": "1.2.0",
    "angular-scenario": "1.2.0"
  }
}

我认为应该加载该模块,我不知道自己在做什么错。有人有建议吗?

谢谢

迈克尔

我怀疑原因是:如果运行grunt test,则因果报应任务将运行。karma的配置位于karma.conf.js文件中。在那里,您必须在files数组中添加angular-animate.js

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

未捕获的错误:模块“ myApp”不可用!(AngularJS)

来自分类Dev

AngularJS和Ionic Framework:模块不可用错误

来自分类Dev

错误:[$ injector:nomod]模块不可用

来自分类Dev

AngularJs-模块已定义,但仍然出现“不可用”错误

来自分类Dev

模块“角度”不可用

来自分类Dev

角模块不可用

来自分类Dev

模块“ ngRaven”不可用

来自分类Dev

角度模块不可用

来自分类Dev

模块“ ngRaven”不可用

来自分类Dev

模块“ mainApp”不可用

来自分类Dev

模块“mdPickers”不可用

来自分类Dev

Phoenix错误:模块未加载/不可用

来自分类Dev

Angular.js:错误:模块“ MyApp”不可用

来自分类Dev

Angular.js错误,模块“ testApp”不可用

来自分类Dev

AngularJS LocalStorageModule不可用

来自分类Dev

错误网页不可用

来自分类Dev

“ $ injector:modulerr”:模块名称的抛出错误不可用,但实际上可用

来自分类Dev

模块“模板”不可用!在角度js?

来自分类Dev

jQuery($)在模块文件中不可用

来自分类Dev

模块“智能表”不可用

来自分类Dev

业力抱怨'模块不可用'

来自分类Dev

auth在模块中不可用

来自分类Dev

由于以下原因,无法实例化模块demoApp:错误:[$ injector:nomod]模块'demoApp'不可用

来自分类Dev

AngularJS模块'ui.router'对我的Djangular项目不可用

来自分类Dev

为什么我已经定义了AngularJS中的“模块'myControllers'不可用”?

来自分类Dev

AngularJS测试-ngGrid不可用

来自分类Dev

Python中的子流程模块出现资源暂时不可用的错误

来自分类Dev

Angular,Jasmine模拟了整个模块的依赖性,“不可用!” 错误

来自分类Dev

错误:[$ injector:nomod]模块'ui.bootstrap'不可用!您拼错了[...]

Related 相关文章

热门标签

归档