Skip to content

Instantly share code, notes, and snippets.

@seedifferently
Created October 27, 2014 15:57
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 seedifferently/79a19e6c39553826af3c to your computer and use it in GitHub Desktop.
Save seedifferently/79a19e6c39553826af3c to your computer and use it in GitHub Desktop.
AngularJS API Error Message directive
angular.module 'app'
.directive 'apiErrorMessage', ->
dir = {}
dir.restrict = 'A'
dir.scope =
field: '=apiErrorMessage'
dir.priority = 100
dir.transclude = true
dir.template = "{{field.$error.message}}"
# Make sure CoffeeScript alawys returns this
return dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment