$validator ignores $setValidity in Password Form

93 views Asked by At

I have a validator

model.$validators.passwordMatch = function (modelValue) {
    var repeatPasswordIsValid = (/*some test*/);

    return repeatPasswordIsValid;
};

And from another place I test something else set the validity of the same form

repeatPasswordModel.$setValidity('passwordMatch', true);

The problem is that $setValidity is completely ignored and only the validator's test is applied to the form validity. If is setValidity to true, and the validator return false, then it will be false. I would like it to override and to be true, am I missing something?

This is the full code of the directive: http://codepen.io/anon/pen/xgKmLJ

0

There are 0 answers