【发布时间】:2020-09-24 05:55:27
【问题描述】:
我正在将我的 Ionic3 应用程序移植到 Ionic5 中,并且目前正在添加我的 http 请求。 在 Ionic3 中,我使用了 angular/http,但似乎是 deprecated。 这是我的带有 observables 的代码:
this._http.get(requestURL)
.map((result: Response) => {
return this.run(result.json())
});
现在,我如何使用 Ionic5 完成与 http 相同的实现?
Rx.Observable.fromPromise(fetch(url));
?
以上似乎不起作用。 fromPromise does not exist on Rx.Observeable.
【问题讨论】:
-
你使用的是什么 RxJS 版本?
-
刚刚检查 - 6.5.1
标签: typescript ionic-framework rxjs ionic5