gpt4 book ai didi

angularjs - angular 1.5.5 material design 给我 Unknown provider : $$HashMapProvider <- $$HashMap <- $$animateQueue <- $animate error

转载 作者:行者123 更新时间:2023-12-02 17:16:11 26 4
gpt4 key购买 nike

我正在尝试使用 Angular Material 1.5.5 和 Angular 1.6.5。我的代码如下所示:

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>

应用程序.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"
}
}

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

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 等等。

所以升级angular-messageangular-ariaangular-animate的版本从1.5.51.6.5

关于angularjs - angular 1.5.5 material design 给我 Unknown provider : $$HashMapProvider <- $$HashMap <- $$animateQueue <- $animate error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46154916/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com