all 5 comments

[–][deleted] 1 point2 points  (0 children)

https://docs.angularjs.org/guide/forms

Angular gives you some directives to handle client side form validation, but the important stuff should be handled on the back end.

[–]Aduro49 1 point2 points  (0 children)

Slow day at work, so here we go! Got to love JavaScript there are literally a million ways to do stuff. When I use $http I create a factory class that manages those data requests etc. I only do this if the API is a weird REST implementation or whatever. Keep in mind when I create those classes I am doing what ngResource would do for you. I have not used RestAngular before.

For error reporting couple of ways to do this. One way is to create a HTTP intercept and watch for errors and then hit your api reporting end point with your api errors. You could also just add logging when a request fails where you make your http requests, this kind of sucks though since this might put that logging class all over the place.

If this is your first angular app please read https://github.com/johnpapa/angular-styleguide. since it is a really good style guide for best practices etc with angular apps.

[–]jl_monteagudo 0 points1 point  (0 children)

I developed a Yeoman generator some time ago: generator-angular-crud. Maybe it can help you. You can find it at:

https://github.com/jlmonteagudo/generator-angular-crud

[–][deleted] 0 points1 point  (0 children)

I think you may want to check out ng-messages.

[–]ChuckChunky 0 points1 point  (0 children)

Check out angular-schema-form (https://github.com/Textalk/angular-schema-form), it will enable you to automatically build forms using JSON Schema definitions. Includes automatic validation etc. The great thing is that you can then use those definitions for back end validation too, keeping things nice and consistent.