My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Server-side validation for angular?

Cyrus Boadway's photo
Cyrus Boadway
·Oct 20, 2016

Sometimes, client-side only field validation isn't possible. A simple example is field uniqueness checks like making sure a username isn't already in use, but other times there are validations that can only be applied with the submission of the entire form (i.e. violations encoded in an HTTP 400 server response).

What tools or practices have you used to manage server-side validation in you angular applications?

Edit: To be clear, I'm talking about this scenario:

  1. Form submits.
  2. Backend determines field A is 'invalid', returns HTTP 403, with a json message that indicates which fields are invalid and why.
  3. Angular takes in that message and adds annotations to the form elements (e.g .ng-messages).

What tools exist to handle step 3, in part or in whole?