Skip to content

Instantly share code, notes, and snippets.

View rcullito's full-sized avatar

Rob Culliton rcullito

View GitHub Profile
@rcullito
rcullito / ngEnter.js
Last active August 29, 2015 14:13 — forked from EpokK/ngEnter.js
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind("keydown keypress", function(event) {
if(event.which === 13) {
$timeout(function(){
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}