Auth Service
logout() {
return this.http.post(this.logOutApi, null);
}
The status code doesn\'t show in the json response from t
Other than 200 you get the status code in your error block. So here you will have to handle accordingly like below
logout() {
this.chk.logout().subscribe((res: any)=>{
if(res.status == 200) //doesnt work{
console.log(res);
})
}
}, (error)=>{
if (error.status === 500) {
alert('Server down please try after some time');
}
else if (error.status === 404) {
alert('Server down. Please try after some time');
}
});
}
Hope this help