ngEnter directive if you can use submit form(https://twitter.com/ririlepanda)
app.directive('onEnter', function() {
return {
restrict: "A",
scope: {
action: "&onEnter"
},
link: function(scope, element, attrs) {
element.on("keydown keypress", function(event) {
if(event.which === 13) {
scope.$apply(scope.action);
event.preventDefault();
}
});
}
};
});