使用ui-router时AngularJS可能发生未处理的拒绝 [英] AngularJS possible unhandled rejection when using ui-router
问题描述
从ngRoute更改为angular-ui-router后,控制台始终显示4条错误,指出:可能未处理的拒绝:{}
After I have changed from ngRoute to angular-ui-router the console shows always 4 errors stating: Possibly unhandled rejection: {}
我在构建的应用程序的行为中没有发现任何问题",但是我想摆脱它.
I did not noticed any "problem" in the behavior of the application I am building, but I would like to get rid of it.
任何想法都意味着什么以及如何解决?
Any idea what does it mean and how to solve it?
以下是屏幕截图:
推荐答案
在1.5.9和1.6.0-rc-0中发现了此问题. 有关更多详细信息,请参见 https://github.com/angular-ui/ui-router/issues/2889
This issue is found in 1.5.9 and 1.6.0-rc-0. More details at https://github.com/angular-ui/ui-router/issues/2889
补丁解决方案是手动禁用未处理的拒绝.
Patch solution is to manually disable unhandled rejections.
app.config(['$qProvider', function ($qProvider) {
$qProvider.errorOnUnhandledRejections(false);
}]);
这篇关于使用ui-router时AngularJS可能发生未处理的拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!