导入forkJoin但仍然得到"不是函数"

Roh*_*hit 2 rxjs angular

我进口forkJoin

import 'rxjs/add/observable/forkJoin';
Run Code Online (Sandbox Code Playgroud)

但我的控制台中仍然出现错误:

__WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__.a.forkJoin is not a function
Run Code Online (Sandbox Code Playgroud)

我没有在Angular CLI编译器中使用此错误(使用ng serve),VS代码也没有抱怨.现在有不同的运行forkJoin的方法吗?我正在使用RxJS 5.5.*运行最新版本的Angular(5.*).

根据要求,它被称为:

Observable.forkJoin(
    this.eventService.getTypes().first(),
    this.eventService.getDates().first()
).pipe(
Run Code Online (Sandbox Code Playgroud)

mar*_*tin 6

使用RxJS 5.5,您应该将其用作函数.我不确定Angular CLI 1.5和更新版本是否配置为使用较旧的原型修补样式的RxJS.

import { forkJoin } from 'rxjs/observable/forkJoin'

...

forkJoin(...).pipe(...).subscribe(...);
Run Code Online (Sandbox Code Playgroud)