I have a form in which I am checking if email is already exists. If it is already exists I am showing the error msg from json response. this part is done (this is i am checking when user click on submit button).
I am getting 409 error if email already exists.
I need to update email input filed. Need to add a msg That email already exists. I am using ng-show="personalInfo.$submitted"
<form name="personalInfo" role="form" autocomplete="off">
<div class="form-group">
<input type="text" maxlength="11" class="form-control" name="usupiEmail" ng-model="usuAttributes.personalInfo.email" ng-focus="ShowPlaceholder('email')" />
<label>Email ID</label>
<div class="error-message" ng-show="personalInfo.$submitted" ng-cloak>
Please verify your Email.
</div>
</div>
<button type="submit" class="btn-default" ng-click="usupiUpdateUser()">Next</button>
I have tried different method also:
function checkWrongEmail (errorCode) {
if (errorCode === '409') {
return true;
}
return false;
}
personalInfo.$submitted(by the way, you're probably misuing it, as it should beusuAttributes.personalInfo.$submitted? When you get the response from the server with a 409 error, you can update this property with atruevalue. That way, it'll show the intended message for that error.