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

Adding message to invalid and valid callback functions. #122

Merged
merged 4 commits into from
Jul 10, 2015

Conversation

tylergraf
Copy link
Contributor

Feature

I love all of the features you have here, I just wanted to be able to use my own error/success function to display the message so I added the message in the callback function.

How to use

html

<input type="text" ng-model="name" name="inputName" validator="required" valid-callback="validationValidHandler(message)" invalid-callback="validationInvalidHandler(message)">

Javascript

scope.validationValidHandler = function(message){
  // you now have access to the error message
  displayMessage(message, 'success');
};

scope.validationInvalidHandler = function(message){
  // you now have access to the error message
  displayMessage(message, 'error');
};

Bug Fix

I changed inValidCallback to invalidCallback since the html attribute in the docs is invalid-callback not in-valid-callback 😄

Let me know what you think. Thanks!

@hueitan
Copy link
Owner

hueitan commented Jun 25, 2015

Cool, it's useful. Before merging, do you mind giving a documentation on README.md API.md about this change?

@hueitan
Copy link
Owner

hueitan commented Jun 25, 2015

and in-valid-callback is one of the bug I think XD

@tylergraf
Copy link
Contributor Author

Cool. Yeah, I'll add documentation. Thanks!

@hueitan
Copy link
Owner

hueitan commented Jun 25, 2015

Thanks!

@tylergraf
Copy link
Contributor Author

@huei90 Sorry I haven't gotten around to this until now. I think it's ready to go now.

@hueitan
Copy link
Owner

hueitan commented Jul 10, 2015

👍 @tylergraf Thanks for this fixing. Great 🍻

hueitan pushed a commit that referenced this pull request Jul 10, 2015
Adding message to invalid and valid callback functions.
@hueitan hueitan merged commit ef425a9 into hueitan:master Jul 10, 2015
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

Successfully merging this pull request may close these issues.

2 participants