使用 ui-router 时 AngularJS 可能会出现未处理的拒绝 [英] AngularJS possible unhandled rejection when using ui-router

查看:14
本文介绍了使用 ui-router 时 AngularJS 可能会出现未处理的拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我从 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屋!

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