.directive('ngEnter', function() { return function(scope, element, attrs) { element.bind("keydown keypress", function(event) { if (event.which === 13) { scope.$apply(function() { scope.$eval(attrs.ngEnter, { 'event' : event }); }); event.preventDefault(); } }); }; });
Rants and ravings of a semi-autistic developer who has a hard time remembering idiotic nonsense details. Why remember it, when you know where to find it.
Friday, July 4, 2014
Angular ng-enter Directive
Just copied it from somewhere to keep for myself .. I mostly put it in the app.js at the bottom so everyone is able to use this function.
Labels:
angular,
angularjs,
directive,
javascript
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment