首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >AngularJS错误:模块ngAnimate不可用

AngularJS错误:模块ngAnimate不可用
EN

Stack Overflow用户
提问于 2014-01-04 21:25:43
回答 1查看 22K关注 0票数 18

我是angular的新手,遇到了一个问题。我使用了yeoman角度生成器,并添加了ngAnimate模块。当我运行grunt test时,我得到以下错误:

代码语言:javascript
复制
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

代码语言:javascript
复制
'use strict';

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

index.html

代码语言:javascript
复制
<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

代码语言:javascript
复制
{
  "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"
  }
}

我认为模块应该被加载,我不知道我做错了什么。有没有人有建议?

谢谢

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20921594

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档