Skip to content

Instantly share code, notes, and snippets.

@emiaj
Created August 22, 2013 16:21
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 emiaj/6309472 to your computer and use it in GitHub Desktop.
Save emiaj/6309472 to your computer and use it in GitHub Desktop.
app.directive 'enterKey', ($timeout) ->
(scope, elem, attrs) ->
elem.bind 'keydown', (e) ->
if e.keyCode is 13
$timeout ->
scope.$apply attrs.enterKey
, +attrs.enterKeyDelay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment