如何在Angular 5中使用Bluebird Promise? [英] How to use Bluebird promises with Angular 5?

查看:57
本文介绍了如何在Angular 5中使用Bluebird Promise?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是指向Plunker的链接

我有一个项目,其中的本地 Promise 实现被Bluebird的实现所替代.据我了解,为了在这种情况下成功使用Angular 5,必须对Bluebird进行修补,以使其具有区域感知"能力.为此,我遵循

I have a project within which the native Promise implementation is replaced with that of Bluebird. It is my understanding that in order to successfully use Angular 5 in this scenario, Bluebird must be patched in order to be made "zone aware." To accomplish this, I am following the instructions shown here.

这似乎不起作用.Zone.js引发以下错误:

This doesn't seem to work, though. Zone.js throws the following error:

未捕获到的RangeError:超出了最大调用堆栈大小

有人知道解决方案吗?谢谢.

Does anyone know the solution to this?Thanks in advance.

推荐答案

最新版本的zone.js已支持bluebird,请等待新版本的zone.js(0.8.21).

Newest version of zone.js have supported bluebird, please wait for the new version of zone.js (0.8.21).

https://github.com/angular/zone.js/pull/1039

关于用法,您可以在这里找到.https://github.com/angular/zone.js/blob/master/NON-STANDARD-APIS.md#currently-supported-non-standard-common-apis

About usage, you can find here. https://github.com/angular/zone.js/blob/master/NON-STANDARD-APIS.md#currently-supported-non-standard-common-apis

这篇关于如何在Angular 5中使用Bluebird Promise?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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