zettapi_client
Version:
Client side CRUD operations in angular to use with zettapi_server rest api to get started quickly in any CMS project
20 lines (16 loc) • 427 B
JavaScript
app.directive('dlKeyCode', dlKeyCode);
function dlKeyCode() {
return {
restrict: 'A',
link: function($scope, $element, $attrs) {
$element.bind("keypress", function(event) {
var keyCode = event.which || event.keyCode;
if (keyCode == $attrs.code) {
$scope.$apply(function() {
$scope.$eval($attrs.dlKeyCode, {$event: event});
});
}
});
}
};
}