我的代码是
import 'rxjs/Rx';
...
let _this = this;
return new Promise(function(resolve, reject) {
_this.http[method](url, data, {
headers: headers
})
.toPromise()
.then(
(data) => {
resolve(data);
},
error => {
reject(error);
}
);
});
"订阅"不是来自我的代码,看起来像是有角度的原始东西.
错误信息:
EXCEPTION: Error: Uncaught (in promise): TypeError: _this.http.get(...).subscribe is not a function