Angular文档中提到了一个名为"throwError"的类,其导入语句如下所示。
import { Observable, throwError } from 'rxjs';
但是我的编译器无法找到这个类,并且会显示以下错误信息:
src/app/shared/services/myservice.service.ts(3,10) 中的错误: TS2305: 模块“D:/workspace/dev/MyProject/node_modules/rxjs/Rx”没有导出成员“throwError”。
以下是我的环境详细信息:
Angular CLI: 1.6.8
Node: 8.11.1
OS: win32 x64
Angular: 5.2.8
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
@angular/cdk: 5.2.4
@angular/cli: 1.6.8
@angular/material: 5.2.4
@angular/service-worker: 1.0.0-beta.16
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.4.5
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.4.2
webpack: 3.10.0
我错过了什么?