在Angularjs项目中注入未知提供程序

时间:2017-01-03 10:17:14

标签: javascript angularjs node.js npm npm-install

运行我的角应用程序时出现此错误。我已经使用npm安装了所有软件包。这个问题是否导致了角度和角度动画之间的版本冲突?

Uncaught Error: [$injector:unpr] Unknown provider: $$isDocumentHiddenProvider <- $$isDocumentHidden <- $$animateQueue <- $animate <- $compile <- $$animateQueue
http://errors.angularjs.org/1.4.14/$injector/unpr?p0=%24%24isDocumentHidden…eQueue%20%3C-%20%24animate%20%3C-%20%24compile%20%3C-%20%24%24animateQueue
    at angular.js:68
    at angular.js:4381
    at Object.getService [as get] (angular.js:4529)
    at angular.js:4386
    at getService (angular.js:4529)
    at Object.invoke (angular.js:4561)
    at angular.js:4387
    at getService (angular.js:4529)
    at Object.invoke (angular.js:4561)
    at angular.js:4387

有人可以解释该做什么吗?

2 个答案:

答案 0 :(得分:1)

您必须将角度动画版本降级为Angular版本。

如果您使用过bower install,请转到bower.json文件。在那里,您可以看到"angular-animate": "some version",将值替换为1.4(如果使用Angular 1.5,则替换为1.5)。

答案 1 :(得分:0)

我只想确认Shikha的回答。 我遇到过同样的问题。我的角度版本是1.5.x,我的角度动画版本是1.6.x 结果,我得到了以下错误:

eQueue%20%3C-%20%24animate%20%3C-%20%24compile%20%3C-%20%24%24animateQueue.

所以,我不得不用以下命令将我的角度动画降级到版本1.4.x:

npm install angular-animate@1.4.8

然后,它运作良好。