Created
October 27, 2014 15:57
-
-
Save seedifferently/79a19e6c39553826af3c to your computer and use it in GitHub Desktop.
AngularJS API Error Message directive
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
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