Sign in
Log inSign up

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?

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct