(function () { 'use strict'; angular.module('fix.stopPropagation', []) .directive('fixStopPropagation', [function () { return { link: function (scope, element, attr) { var fn = function (e) { e.stopPropagation(); }; if (angular.isDefined(attr['fixStopPropagation'])) { attr['fixStopPropagation'].split(' ').forEach(function (name) { element.on(name, fn); }); } else { element.on('click', fn); } } }; }]); })();