Display a Server Side Validation Error Response onto an Angular Form

Share this video with your friends

Send Tweet

In Angular we have different kind of validators. Client-side and client-side async validators which call a function on the server. Often however, after satisfying all client-side validators, you may want to send the form to the server for validation. In case of an error, the server needs to be able to communicate that back to the client where we want to display it directly on the single form fields again. In this lesson I'll show you a possible approach of implementing such scenario, returning a 422 status code, processing the response format we specify in the lesson and display it on the Angular form field again

Venky Venkataraman
~ 2 years ago

Brilliant tutorial Juri. Love your tutorials. Exactly what I was looking for. I work for a company and we are just starting on our Angular journey and I am trying to figure out how to handle server side validation errors and this tutorial will sure come handy. Brilliant !!!

Juri Strumpflohnerinstructor
~ 2 years ago

Thank you Venky ๐Ÿ˜Š. Glad you liked it. There's the corresponding article also on my site if u wish: https://juristr.com/blog I'm planning to have some more such hands-on tutorials of use cases that come up very often in enterprise apps, so stay tuned ๐Ÿ˜‰

Venky Venkataraman
~ 2 years ago

Thanks Juri. I have the article on my to-do read list. This tutorial here is exactly what we need to do in an enterprise app. As we go along we will have backend team working on API / Microservices and the business is planning on a Business Rules Validation engine. So I guess, when the Angular app is going to send a payload to the backend API it will validate the payload and if doesn't pass the business validation, it is going to return back a server validation error that the Angular app then needs to show on the UI. Exactly what we want and what you have described in this tutorial. Brilliant, loved it.