My code
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);
}
);
});
"subscribe" fails from my code, it looks like the angular original.
Error message:
EXCEPTION: Error: Uncaught (in promise): TypeError: _this.http.get (...). Subscribe is not a function
nbsp source share