Skip to content

Instantly share code, notes, and snippets.

@lamarmarshall
Last active December 2, 2015 03:46
Show Gist options
  • Save lamarmarshall/70a4f71637d5977a64f0 to your computer and use it in GitHub Desktop.
Save lamarmarshall/70a4f71637d5977a64f0 to your computer and use it in GitHub Desktop.
angular form submited
<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 || theForm.$submitted)
}">
<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