Skip to content

Instantly share code, notes, and snippets.

@gorork
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gorork/149b62aeadc7a43d8233 to your computer and use it in GitHub Desktop.
Save gorork/149b62aeadc7a43d8233 to your computer and use it in GitHub Desktop.
User-friendly validation AngularJS directive
<!--
AngularJS directive
type: AE
1. pass a field name (e.g. "formName.fieldName") into the "messages-for" attribute;
2. pass a scope expression that returns "true" when users tries to submit the given form
-->
<!-- Validate Messages directive starts -->
<div validate-messages messages-for="siteForm.siteName" submitted="submitted"></div>
<!-- Validate Messages directive ends -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment