(function () { "use strict"; var name = 'adConfirmClick'; angular.module('app.directive') .directive('adConfirmClick', [function () { return { link: function (scope, element, attrs) { element.on('click', function () { var message = attrs[name + 'Msg'] || 'Confirm'; if (confirm(message)) { scope.$apply(attrs[name]); } }); } } }]); })();