I am working on an Angular app in which I am making a rest call through HTTP as below:
login(email, password) {
let headers = new Headers();
headers.a
Most of my issues were related to the imports, so here's the code that worked for me...
import {_throw} from 'rxjs/observable/throw';
login(email, password) {
...
return this.http.post(`${this._configService.getBaseUrl()}/login`, body, options)
.map((res: any) => {
...
if (response.success == 0) {
_throw(response);
} else if (response.success == 1) {
...
}
});
}
This will be the solution if you are facing errors like...
ERROR TypeError: WEBPACK_IMPORTED_MODULE_2_rxjs_Observable.Observable.throw is not a function