当前位置: 动力学知识库 > 问答 > 编程问答 >

Importing rxjs in an angular2 component gives error

问题描述:

In my angular2 component, I have

import * as Rx from '@reactivex/rxjs';

The Visual Studio complaints that 'Cannot find module @reactivex/rxjs'

I see that @reactivex\rxjs is installed under node_modules under angular2. The following is the folder structure.

node_modules\angular2\node_modules\@reactivex\rxjs

How can I fix so I can use Rx in the component?

UPDATE:

A similar issue from Github.

网友答案:

Which version of alpha are you using? I am using Alpha-45 and the following works for me: import * as Rx from "@reactivex/rxjs/dist/cjs/Rx";

分享给朋友:
您可能感兴趣的文章:
随机阅读: