In the service, there is this code :
getUser(id){
return this.http.get('http:..../' + id)
.map(res => res.json());
}
In the component :
this.myService.getUser(this.id).subscribe((customer) => {
console.log(customer);
this.customer = customer,
(err) => console.log(err)
});
When it's the 'customer' exist, no problem I get all the information about the customer.
When the id does not exist, the web api return 'BadRequest' with a message. How can I get this message ? the status ?
Thanks,