Testing it out

Now that the Component HTML template has been set up, we can test the result of our hard work: press F5, navigate to the Cities view, click the Add a new City button, and insert the following values:

  • NameNew Tokyo
  • Latitude35.685
  • Longitude139.7514
  • Country: Japan

If you did everything properly, you should be greeted by the following error message:

That's great! Our custom async validator is working fine and triggers both the front-end and the back-end validation logic.

Get ASP.NET Core 3 and Angular 9 - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.