Is there an approach that preserves the single-definition of validation, allows immediate client-side validation, and still provides the strength of server-side validation?
The approach I recommend is based on @Esteban Felix commented and I used similar strategy in Java/Bean Validation and JSON schema generator.
Annotate your Domain model using Validate Model Data Using DataAnnotations
Generate schema using JSON.net other useful links
Create a AutoValidate
directive that goes on and decorate fields with AngularJS
build in directives for form validation e.g. ngPattern
and simple things like min/max
. In my case I created a mapping from Java world to AngularJS directives and wherever I needed we created custom directives.