doSelectMessagesAttributesUrl1(pushRequest : PushRequest) {
console.info("sending post request");
let headers = new Headers({
'Content-Type': 'application/x-www-form-urlencoded'});
return this.http
.post(this.selectMessagesAttributesUrl, {headers: headers})
.map(res => res.json().data)
.subscribe(
data => { },
err => { console.error('An error occurred', err) }
);
}
我收到此错误:
EXCEPTION: TypeError: this.http.post(...).map is not a functionBrowserDomAdapter.logError @ platform-browser.umd.js:937
zone.js:461
Unhandled Promise rejection: this.http.post(...).map is not a function ; Zone: <root> ; Task: Promise.then ; Value: TypeError: this.http.post(...).map is not a function(…)
我的http语法中缺少什么?
答案 0 :(得分:4)
您需要导入像
这样的rxjsimport 'rxjs/Rx';