这是我的
我遇到了以下错误:
rxjs没有导出成员“Observable”。
版本是否存在问题?
package.json
文件:"dependencies": {
"@angular/animations": "~7.1.0",
"@angular/common": "~7.1.0",
"@angular/compiler": "~7.1.0",
"@angular/core": "~7.1.0",
"@angular/forms": "~7.1.0",
"@angular/material": "^7.1.1",
"@angular/platform-browser": "~7.1.0",
"@angular/platform-browser-dynamic": "~7.1.0",
"@angular/router": "~7.1.0",
"core-js": "^2.5.4",
"ng2-opd-popup": "^1.1.21",
"rxjs": "~6.3.3",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
service.ts
文件的代码如下:
import { Injectable } from '@angular/core';
import { Http, Headers} from '@angular/http';
import 'rxjs/add/operator/map';
//import { Observable } from 'rxjs/Observable';
//import 'rxjs/add/observable';
import { Observable} from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class EmpService {
employees=[];
constructor(private _http: Http) { }
addEmployee(info){
return this._http.post("http://localhost/data/insert.php",info)
.map(()=>"");
}
}
我遇到了以下错误:
rxjs没有导出成员“Observable”。
版本是否存在问题?