My problem is that when I use http.post method it gives me an error "TypeError: Cannot read property 'toLowerCase' of undefined". What is the problem? I tried downgranding Angular to version 8.0.0 but it doesn't work.
my login service:
login(model: any)
{
return this.http.post(this.baseUrl, model)
.pipe(map((response: any) => {
const user = response;
if(user){
localStorage.setItem('token', user);
}
}));
}
my login method in component:
login(){
this.authService.login(this.model)
.subscribe(next =>{
console.log('You have been logged in');
},err => {
console.log(err);
});
}