Sha256: c95dd6f86e43ba857cb774e1b0763b2894ed2982df7859b96475a8f7fddc0349
Contents?: true
Size: 763 Bytes
Versions: 204
Compression:
Stored size: 763 Bytes
Contents
(function () { 'use strict'; /** * @ngdoc directive * @name Bastion.components.directive:bstOnEnter * * @description * Allows setting an action to be performed when the user presses the enter button. */ function bstOnEnter() { return { scope: true, link: function (scope, element, attrs) { element.bind('keydown keypress', function (event) { if (event.which === 13) { scope.$apply(attrs.bstOnEnter); event.preventDefault(); } }); } }; } angular .module('Bastion.components') .directive('bstOnEnter', bstOnEnter); })();
Version data entries
204 entries across 204 versions & 2 rubygems