Skip to content

Conversation

lambirou
Copy link

<input type="password" name="password" ng-model="form.password" validator="required">
<input type="password" name="password_confirm" ng-model="form.password_confirm" validator="equality=password">

equality=password

  • password is first input attribut name.

<input type="password" name="password" ng-model="form.password" validator="required">
<input type="password" name="password_confirm" ng-model="form.password_confirm" validator="equality=password">

/** equality=password
* 
* password is first input attribut name.
Copy link
Owner

@hueitan hueitan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ! do you mind also update the document https://github.com/hueitan/angular-validation#built-in-validation-in-angular-validation-rule then I will merge this pr, thanks again!

@hueitan hueitan mentioned this pull request Sep 4, 2017
@hueitan
Copy link
Owner

hueitan commented Sep 11, 2017

ping @lambirou

@@ -14,6 +14,10 @@
},
maxlength: function(value, scope, element, attrs, param) {
return !value || value.length <= param;
},
equality: function (value, scope, element, attrs, param) {
var paramVal = document.querySelector('input[name=' + param + ']').value
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use attrs[ param ] instead of globally selector from document.

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