Trong trường hợp của tôi, nó chỉ đủ để bao gồm bản đồ và lời hứa:
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';
Tôi đã giải quyết vấn đề này bằng cách nhập một số thành phần rxjs như tài liệu chính thức khuyến nghị:
1) Nhập câu lệnh trong một tệp ứng dụng / rxjs-oper.ts:
// import 'rxjs/Rx'; // adds ALL RxJS statics & operators to Observable
// See node_module/rxjs/Rxjs.js
// Import just the rxjs statics and operators we need for THIS app.
// Statics
import 'rxjs/add/observable/throw';
// Operators
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/switchMap';
import 'rxjs/add/operator/toPromise';
2) Nhập chính toán tử rxjs trong dịch vụ của bạn:
// Add the RxJS Observable operators we need in this app.
import './rxjs-operators';