Created
August 22, 2013 16:21
-
-
Save emiaj/6309472 to your computer and use it in GitHub Desktop.
This file contains 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
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