Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

angularValidation.revalidate problems #150

Closed

Description

@jsolt

I'm having a problem using angularValidate.revalidate.

It looks like the change introduced in v1.5.13 broke it, because if I switch back to 1.5.12 it works.

I used the punker in the wiki: http://plnkr.co/o1fftbnmRfjScEDmi7ZH?p=preview and it works, but it's got the old code. If I copied the most recent code in it stops working.

Activity

  1. ghiscoding commented on Apr 14, 2017

    @ghiscoding
    Owner

    Latest version is 1.5.18, you're quite behind. Can you troubleshoot and find the problem, because I don't have much time to look into this right now.

    Try with latest version just to see

  2. jsolt commented on Apr 14, 2017

    @jsolt
    ContributorAuthor

    I was on 1.5.18 when I noticed it, I narrowed it down to the 1.5.13 change (I think)

    I think it's this in validation-directive.js

            scope.$on('angularValidation.revalidate', function(event, args){
              if (args == ctrl.$name)
              {
                ctrl.revalidateCalled = true;
                var value = ctrl.$modelValue;
    
                if (!!elm && elm.hasOwnProperty("isValidationCancelled")) {
                  // attempt to validate & run validation callback if user requested it
                  var validationPromise = attemptToValidate(value);
                  if(!!_validationCallback) {
                    commonObj.runValidationCallbackOnPromise(validationPromise, _validationCallback);
                  }
                }
                else {
                  ctrl.$setValidity('validation', true);
                }
              }
            });

    elm.hasOwnProperty("isValidationCancelled") doesn't seem to ever evaluate to true.

    I'm not 100% sure, but I think elm is wrong type of thing to be evaluating, that other parts of the code are setting that property on a different object.

  3. ghiscoding commented on Apr 14, 2017

    @ghiscoding
    Owner

    What I suggest you to do is to debug it using the plunker sample you got and use validation-directive.js of version 1.5.18 and then revert some of the code change of the old version vs new version until you find the culprit. If you can find what it is, I can help out afterward.

    Thanks for the help

  4. added a commit that references this issue on Apr 18, 2017
    d253eab
  5. ghiscoding commented on Apr 18, 2017

    @ghiscoding
    Owner

    New release v1.5.19 pushed with your fix. Thanks again for the contribution :)

  6. jsolt commented on Apr 18, 2017

    @jsolt
    ContributorAuthor

    Awesome, thanks for the super quick turnaround, now we're up to the latest version again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions