Angular error handling

To test the Angular application remember to run the web api in Production mode!

dotnet run --environment=Production

In login() change the console.log in

console.log(error);

Temporarly remove [disabled]="!loginForm.valid" from the submit button, so we can send an empty form.

Submitting the form we can see the 400 (Bad request) in the console.

The interesting part is the body:

{
  "Password":["The Password field is required."],
  "Username":["The Username field is required."]
}

Here we can see the server side validation errors.