Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Add model validations #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add model validations #14

wants to merge 2 commits into from

Conversation

kazalt
Copy link

@kazalt kazalt commented Mar 17, 2014

No description provided.

@Danita
Copy link

Danita commented May 7, 2014

Is this repository alive?

@bfanger
Copy link
Owner

bfanger commented May 7, 2014

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.

@Danita
Copy link

Danita commented May 7, 2014

Thanks a lot.

xob pushed a commit to cognibox/angular-activerecord that referenced this pull request Apr 16, 2019
accept to have no error message
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants