RxJS v6迁移,我不明白有什么不对?

时间:2018-06-02 23:16:43

标签: angular rxjs6

我更新到Angular 6.没有安装rxjs-compat。 更改我的代码

import {Observable} from "rxjs/Observable";

import {Observable} from "rxjs";

等等。
但是,如果我服务,我会收到错误

ERROR in node_modules/primeng/components/accordion/accordion.d.ts(4,10): error TS2305: Module '"../JetBrains/WebstormProjects/test5/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
node_modules/primeng/components/common/confirmationservice.d.ts(1,10): error TS2305: Module '"../JetBrains/WebstormProjects/test5/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/primeng/components/common/messageservice.d.ts(1,10): error TS2305: Module '".../JetBrains/WebstormProjects/test5/node_modules/rxjs/Observable"' has no exported member 'Observable'.
...

等等。
如何解决这些错误?

1 个答案:

答案 0 :(得分:0)

请尝试在Angular 8中为我运行以下命令。

npm install --save-dev rxjs-compat