Skip to content

Instantly share code, notes, and snippets.

@brandly
Last active December 26, 2015 19:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brandly/7199005 to your computer and use it in GitHub Desktop.
Save brandly/7199005 to your computer and use it in GitHub Desktop.
angular.module('$app.directives')
.directive 'showAfterEvent', ['$timeout', ($timeout)->
return {
link: (scope, element, attrs) ->
eventName = attrs.showAfterEvent
element.css 'opacity', 0
element.bind eventName, (e) ->
$timeout ->
element.css 'opacity', ''
, 150
scope.$on '$destroy', ->
element.unbind eventName
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment