Is there an approach that preserves a single definition of validation, allows immediate client-side validation, and still provides robust server-side validation?
I am familiar with the following two approaches:
The first outputs the ng-validation syntax in the Razor output based on the rules specified in the model. It seems like he connects me too much with creating Razor views when Razor looks often don't intuitively mate with a well-organized Angular app. I could use this approach, but it seems to be more the result of someone who wants to replicate "Unobtrusive jQuery / MVC Validation" than to create something well suited for Angular.
The second approach simply returns server-side confirmation on Angular for rendering. He also does not do a thorough job. If necessary, I could work without checking on the client side, since a single-page application will still not receive screen flashes ... but this is not ideal.
For example, maybe there is a set of tools to more accurately reflect the validation rules directly on the WebAPI and consume them in an Angular application. Or another approach that I have not found?
At https://www.youtube.com/watch?v=lHbWRFpbma4#t=1336 , the presenter seems to imply that this problem is already well resolved for Angular and relates to specification ( DDD Using the specification template for validation ). If you know of any tools that make this applicable to my problem, I would love to hear that.
ps It seems like this is almost certainly a frequently asked question. I'm sorry, I could not find the answer here before posting
pps I am currently planning on using the Entity Framework, but I would switch to this. Hell, I would think about switching to a completely different platform for this, my first Angular focus project.
angularjs validation asp.net-mvc
shannon
source share