angular validation

Aug 3 2017 8:28 AM
<form>
<h2 class="text-primary text-center">Registration Page for Student</h2><br />
<div ng-form="subForm">
<div class="form-group ">
<div class="has-feedback" ng-class="{'has-error':subForm.name.$error.required && !subForm.name.$pristine && !subForm.name.$submitted}">
<input type="text" name="name" ng-model="register.Email" class="form-control" placeholder="Enter EmailId" required />
<i class="form-control-feedback glyphicon glyphicon-envelope"></i>
<p ng-show="subForm.name.$error.required && !subForm.name.$pristine && !subForm.name.$submitted" class="help-block">This field is required.</p>
</div>
</div>
<div class="form-group ">
<div class="has-feedback" ng-class="{'has-error':subForm.pass.$error.required && !subForm.pass.$pristine }">
<input type="text" name="pass" ng-model="register.Password" class="form-control" placeholder="Enter Password" required />
<i class="form-control-feedback glyphicon glyphicon-lock"></i>
<p ng-show="subForm.pass.$error.required && !subForm.pass.$pristine" class="help-block">This field is required.</p>
</div>
</div>
</div>
<input id="Text1" ng-model="register.Name" class="form-control" placeholder="Enter Name" type="text" /><br />
<input id="Text1" ng-model="register.Address" class="form-control" placeholder="Enter Address" type="text" /><br />
<input id="Text1" ng-model="register.City" class="form-control" placeholder="Enter City" type="text" /><br />
<input id="Button1" ng-click="savedata()" class="form-control btn btn-primary" type="button" value="{{btnText}}" />
</form>
 
 
 
========The above code is working ...but the problem is in validation...
i design this form as a registration page ...after click in the button (for savedata())  i did'nt redirect in any page ,,, i want to stay in the same page ...
so befoure clicking the button the angular validation is working , and its showing proper message also ....
but after click (after data saving)  also that previous error message is comming (form validation message...)...
 
how to solve this problem.....????? 

Answers (3)