In the registration form, I want to do a duplication check. When duplicated, a message appears under the input field.
<div class="form-group">
<label class="col-md-2 control-label"><strong>Email</strong></label>
<div class="col-md-10">
<input type="email" class="form-control" name="usr_Email"
ng-model="usrEmail" ng-keyup="checkDuplicate()">
<span class="help-block"
ng-show="signupForm.$submitted || signupForm.usr_Email.$touched">
<div ng-show="?????" class="text-danger">is duplicated!</div>
</span>
</div>
</div>
to check the duplicate, I received the account number from the server
$scope.user.usrEmail = $scope.usrEmail;
var req = {
method: 'POST',
url: './api/v1/public/checkDuplication',
dataType: 'json',
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
data: angular.toJson($scope.user)
};
$http(req).success(function(data, status, headers, config){
$log.debug($filter('json')(data));
if(data.number == 0){
???????
}
else{
???????????????
}
I am very confused by what I have to write in '???'
Thanks in advance!
source
share