Created
April 2, 2017 09:29
-
-
Save deepal/c09b2033e8a539c06bbdc991352402ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="myForm" novalidate class="form"> | |
<div class="form-group" ng-class="{'has-error': myForm.name.$invalid}"> | |
<label for="name">Name</label> | |
<input class="form-control" type="text" name="name" id="name" name-validator ng-model="name"/> | |
</div> | |
<div class="alert alert-danger" ng-show="myForm.$invalid"> | |
<ul> | |
<li ng-show="myForm.name.$error.required">Name is required!</li> | |
<li ng-show="myForm.name.$error.min_length">Name should be at least two characters!</li> | |
<li ng-show="myForm.name.$error.invalid_chars">Name should only contain alphabetic characters!</li> | |
</ul> | |
</div> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment