I have the following in my service:
return this.http.get(this.wakeUrl)
// ...and calling .json() on the response to return data
.map((res:Response) => {res.json()
console.log("Hello")
})
//...errors if any
.catch((error:any) => Observable.throw(error.json().error || 'Server error'));
I can see in the network tab in chrome that the response came back successfully with a 200, but how do I log it in the console? In my component, I want to subscribe to that, but am not getting any output either...
this.myService.makeHttpCall().subscribe(
data => {
console.log(data)
},
err => {
console.log(err);
});
How do I log: 1- As soon as the data comes back in my service? 2- Within the component that I injected the service into?