zettapi_client
Version:
Admin panel and client-side CRUD operations in angular to use with zettapi_server rest api to get started quickly in any CMS project.
18 lines (15 loc) • 432 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).toString();
if (keyCode !== $attrs.code) return;
$scope.$apply(function() {
$scope.$eval($attrs.dlKeyCode, { $event: event });
});
});
}
};
}