When I do HTTP requests, for example a GET request and that i got a status code 400 for invalid given data, it prevents my HTML template to be displayed in the view of my angular app. This is how I deal with it at the moment :
this.myService.getData(neededData)
.subscribe(
(result) => {
this.data = result;
},
(error) => {
if (error) {
console.log("error");
this.anErrorHasOccured = true;
}
}
);
The 'error' is well displayed in the console, but this error prevents my template to be displayed, how can I fix that ?