I know this has been asked before but I can't seem to find the answer, how to read status code from http..?
this.bookingService.save(this.param)
.subscribe(
data =>
swal({
"title": "Succes!",
"text": "Your data saved",
"type": "success",
"confirmButtonClass": "btn btn-secondary m-btn m-btn--wide"
}),
error => console.log('error'),
() => this.router.navigate('Succes')
);
You can get the status code from the error,
To get the error msg back, add a catch that will return the error object: