I want to get the StatusCode value from the post request in order to use it in my component.
This is what I have done:
Api call:
Login(user: User) {
return this.http.post(apiUrl + 'account/Login', user).subscribe();
}
Method in component:
Login() {
this.user.UserName = this.loginForm.controls.userName.value;
this.user.Password = this.loginForm.controls.password.value;
this.api.Login(this.user)
}
Now it is displayed only as error
The result should be like: