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 语法缺少什么?
最佳答案
你需要像这样导入rxjs
import 'rxjs/Rx';
关于http - this.http.post(...).map 不是一个函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39028585/