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:
What tools exist to handle step 3, in part or in whole?
The question is kinda confusing without knowing what your using as your backend and even without that, is very open ended.
Most every form field will have different validation needs as most forms would have different purposes.
What ever language you use for your backend should be able to handle validation - be it PHP, or NodeJS or ASP.net or Ruby or etc... For sure you could use 3rd party modules or packages to validate fields but again, this is based on need and again, without knowing which backend you use, is hard to answer.
What tools or practices have you used to manage server-side validation in you angular applications?
Whatever it takes. If it's an email field, I'll use an email regex string. If it's a textarea, I'll just make sure it's not empty and > 1 character. If it's supposed to be just a number field, something like is_numeric() in php works fine. Depends on the form.
Stian Bakken
Full stack development with NodeJS/Aurelia
I usually place regex validation on the input forms. For example in Norway, mobile-phone numbers are 8 numbers. If 8 numbers are input, I do a quick get-request to check if that phone number is taken. If its not taken, I show a green checkmark, if its taken, I mark the field red.
Same with emails.
As for the objects returned, I only throw 401 when Authentication fails or token is invalid. I usually respond with 200 and
Success JSON
{ success: true, data: { id: 1, name: 'Bill Gates' } }Error JSON
{ success: false, msg: 'E-mail already taken.' }