Module not found ..Cannot resolve module 'rxjs/operators/toPromise with Angular6

社会主义新天地 提交于 2019-12-02 13:10:25

try to remove the import statement. It should work without that. Below code works.

new Observable().toPromise();

From rxjs 5.5, "toPromise: now exists as a permanent method on Observable"

https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md

From rxjs 6 onwards toPromise is not an operator, it is part of observable object, you should be able to access directly without any imports

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!