(function () { 'use strict'; var streamApp = angular.module('streamApp'); streamApp.directive('emailClaimDirective', ['sharingService', EmailClaimDirective]); function EmailClaimDirective(sharingService) { return { restrict: 'E', scope: { ngShow: '=', confirmText: '=', buttonText: '@' }, templateUrl: '/App/Directives/connectionCrudDirective.html?v=6.0.0c', link: function (scope, element, attrs, tabsCtrl) { scope.addConnection = function () { var email = scope.email; sharingService.addUserEmail(scope.email).then(function (data) { if (data.data.isValid) scope.cancel(); scope.confirmText = data.data.message; }); }; scope.cancel = function () { scope.ngShow = false; scope.email = ''; scope.confirmText = ''; }; } }; }; })();