Skip to content

Instantly share code, notes, and snippets.

View Werninator's full-sized avatar
👀

Patrick Werner Werninator

👀
  • Germany
View GitHub Profile
@Werninator
Werninator / ngEnter.js
Last active March 3, 2016 14:51 — forked from EpokK/ngEnter.js
ngEnter directive for AngularJS
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind('keydown keypress', function(event) {
if (event.which !== 13)
return;
scope.$apply(function() {
scope.$eval(attrs.ngEnter);
});