Skip to content

Instantly share code, notes, and snippets.

@sulco
Created March 12, 2016 23:13
Show Gist options
  • Save sulco/accffdf537f6c9b29c41 to your computer and use it in GitHub Desktop.
Save sulco/accffdf537f6c9b29c41 to your computer and use it in GitHub Desktop.
<form name="aForm" novalidate>
<label for="name">Your email</label>
<input type="email" id="name" ng-model="name" name="aField" required>
<ng-messages for="aForm.aField.$error"
ng-show="aForm.aField.$invalid && aForm.aField.$dirty">
<ng-message when="required">This field is required</ng-message>
<ng-message when="email">Please enter a valid email address</ng-message>
</ng-messages>
<button ng-click="save()" ng-disabled="aForm.$invalid">Send</button>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment