Sha256: be72378ba5c8401c69968fb49290fb5c8c8da1f1f3d18575d2a580edb3118001
Contents?: true
Size: 715 Bytes
Versions: 32
Compression:
Stored size: 715 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); } }); } }; } angular .module('Bastion.components') .directive('bstOnEnter', bstOnEnter); })();
Version data entries
32 entries across 32 versions & 1 rubygems