Skip to content

formName.fieldName.$error.ngRemoteValidate doesn't work #25

@junerockwell

Description

@junerockwell

I'm using this to validate an email field remotely.

Looking at the console, the HTTP.GET works exactly as it should and returns {"isValid":bool,"value":"[email protected]"} but my message doesn't show up if isValid is false.

 <span ng-show="userRegistrationForm.email_addr.$error.ngRemoteValidate">
     This email address already exists.
 </span>

And basically, this is what the email field looks like:

<div class="item item-input">

      <span class="input-div">Email</span>
      <input type="email"
             name="email_addr"
             ng-model="userAccountData.email"
             ng-pattern="/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/"
             ng-remote-validate="http://somewhere.com/api/check_email_existence"
             ng-remote-throttle="400"
             ng-remote-method="GET"
             required>
      <span ng-show="userRegistrationForm.email_addr.$error.ngRemoteValidate">
        This email address already exists.
      </span>
    </div>

Maybe I don't know how to use formName.fieldName.$error.ngRemoteValidate so maybe someone can tell me?

Also, I'm not sure about this but I decided to try and output value of formName.fieldName.$error.ngRemoteValidate doesn't work like this:

<span ng-show="userRegistrationForm.email_addr.$error.ngRemoteValidate">
       {{userRegistrationForm.email_addr.$error.ngRemoteValidate}}
        This email address already exists.
 </span>

...and using FireBug (in Firefox), it doesn't show any value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions