angular 1.5.5 材料设计给了我未知的提供者:$$HashMapProvider <- $$HashMap <- $$animateQueue <- $animate 错误 [英] angular 1.5.5 material design gives me Unknown provider: $$HashMapProvider <- $$HashMap <- $$animateQueue <- $animate error

查看:19
本文介绍了angular 1.5.5 材料设计给了我未知的提供者:$$HashMapProvider <- $$HashMap <- $$animateQueue <- $animate 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用角度材料 1.5.5 和角度 1.6.5.我的代码如下所示:

I am trying to use angular material 1.5.5 with angular 1.6.5. My code is as shown below:

index.html

<!DOCTYPE html>
<html>

<head>
    <title>xyz</title>

</head>

<body ng-app="xyz">
    <ng-view></ng-view>
    <script src="bower_components/angular/angular.js"></script>
    <script src="bower_components/angular-route/angular-route.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js"></script>

    <!-- Angular Material Library -->
    <script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>


    <script src="js/app.js"></script>
    <script src="js/config.js"></script>

</body>

</html>

app.js

angular.module('xyz', [
    'ngRoute',
    'ngMaterial',
    'ngAnimate'
]).
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
        $routeProvider.
        when("/home", { templateUrl: "template/home.html", controller: "homeController" }).
        otherwise({ redirectTo: '/login' });
    }]);

bower.json

{
    "name": "xyz",
    "description": "",
    "main": "index.js",
    "authors": [
        "mjet"
    ],
    "license": "ISC",
    "homepage": "",
    "private": true,
    "ignore": [
        "**/.*",
        "node_modules",
        "bower_components",
        "app/bower_components",
        "test",
        "tests"
    ],
    "dependencies": {
        "angular": "~1.6.5",
        "angular-route": "~1.6.5",
        "angular-bootstrap": "~0.13.0",
        "bootstrap": "~3.3.5"
    },
    "resolutions": {
        "angular": "~1.6.x"
    }
}

但不知何故它给了我这个错误:

But somehow it is giving me this error:

SCRIPT5022: [$injector:unpr] Unknown provider: $$HashMapProvider <- $$HashMap <- $$animateQueue <- $animate <- $compile <- $$animateQueue

http://errors.angularjs.org/1.6.6/$injector/unpr?p0=%24%24HashMapProvider%20%3C-%20%24%24HashMap%20%3C-%20%24%24animateQueue%20%3C-%20%24animate%20%3C-%20%24compile%20%3C-%20%24%24animateQueue

推荐答案

如果你使用的是1.6.5版本的AngularJS,你需要使用同版本的angular-ariaangular-animate 等等.

If your are using the version 1.6.5 of AngularJS, you need to use the same version of angular-aria, angular-animate and so on.

所以从1.5.5升级angular-messageangular-ariaangular-animate的版本> 到 1.6.5.

So upgrade the version of angular-message, angular-aria and angular-animate from 1.5.5 to 1.6.5.

这篇关于angular 1.5.5 材料设计给了我未知的提供者:$$HashMapProvider &lt;- $$HashMap &lt;- $$animateQueue &lt;- $animate 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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