Created
December 2, 2015 03:36
-
-
Save lamarmarshall/af41f7396c6655753b59 to your computer and use it in GitHub Desktop.
angular form error messages
This file contains hidden or 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
<p> | |
<label for="email">Email</label> | |
<input type="email" ng-model="formModel.email" name="email" required="required" | |
ng-class="{green: theForm.email.$valid , | |
red: !theForm.email.$valid && !theForm.$pristine | |
}"> | |
<p class="red" ng-show="theForm.email.$error.required && !theForm.$pristine"> | |
email is required | |
</p> | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment