Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server side validations #2

Open
cleesmith opened this issue Nov 27, 2013 · 1 comment
Open

server side validations #2

cleesmith opened this issue Nov 27, 2013 · 1 comment

Comments

@cleesmith
Copy link

In chapter9+recipe1+contacts, for example:

  • entering "jjj" into the age field causes a validation error
  • follow that by entering "123" into to age field should give just that validation error,
    but instead it shows the previous error plus the current validation error

It's like all validations just get appended in app/javascripts/controllers/ContactsEditCtrl.js
in the push within the method errorMessage.

How do you "reset/clear" the validation errors between/before each submit to rails ?

Thanks for the git examples and the book :-)
chris

@JoshuaNovak919
Copy link

I just had to do this myself. I ended up adding the line:

$scope.form.$setPristine();

To the failure function underneath:

console.log("failure", response);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants