Skip to content

Instantly share code, notes, and snippets.

@ryngonzalez
Forked from brandly/showAfterEvent.coffee
Created October 28, 2013 20:19
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 ryngonzalez/7203860 to your computer and use it in GitHub Desktop.
Save ryngonzalez/7203860 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