angular-activerecord icon indicating copy to clipboard operation
angular-activerecord copied to clipboard

Add model validations

Open kazalt opened this issue 10 years ago • 3 comments

kazalt avatar Mar 17 '14 17:03 kazalt

Is this repository alive?

Danita avatar May 07 '14 11:05 Danita

It is, but my spare time is very limited and validation is a complex problem.

The proposed solution deviates from Backbone's implementation and AngularJS already provides (field) validation with ModelController.$setValidity()

Although ActiveRecord currently doesn't have any validation methods, when the backend responds with an http error code, the ActiveRecord.$save() promise is rejected. Utilizing the validation code from the backend prevents code duplication or even worse client-side-only validation.

I might change my mind when i've done a validation heavy project, but for now, if you need frontend validation methods in ActiveRecord, use the kazalt fork.

bfanger avatar May 07 '14 14:05 bfanger

Thanks a lot.

Danita avatar May 07 '14 19:05 Danita