javascript 错误:rxjs/Subject"' 没有导出成员 'Subject'
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50317693/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error: rxjs/Subject"' has no exported member 'Subject'
提问by Lucifer
I have this code:
我有这个代码:
import { Subject } from 'rxjs/Subject';
After importing this, I get the error
导入后,我收到错误
rxjs/Subject" has no exported member 'Subject'.
rxjs/Subject”没有导出成员“Subject”。
I am not able to resolve this.
Could anybody suggest a solution?
我无法解决这个问题。
有人可以提出解决方案吗?
回答by siva636
It looks you use RxJS v6. In v6, the way you import resources has been made much more easy. Your import should be like the following:
看起来您使用的是 RxJS v6。在 v6 中,您导入资源的方式变得更加容易。您的导入应如下所示:
import {Subject} from 'rxjs';
For more details read the migration guide.
有关更多详细信息,请阅读迁移指南。

