(function () { 'use strict'; var streamApp = angular.module('streamApp'); streamApp.directive('connectionCrudDirective', ['sharingService', 'userService', 'groupsService', ConnectionCrudDirective]); function ConnectionCrudDirective(sharingService, userService, groupsService) { return { restrict: 'E', scope: { confirmText: '=', prompt: '=', buttonText: '@', callback: '=', newConnection: '=' }, templateUrl: '/App/Directives/connectionCrud/connectionCrudDirective.html?v=6.0.0c', link: function (scope, element, attrs, tabsCtrl) { scope.model = {}; scope.newConnection = !!scope.newConnection; scope.innerText = scope.buttonText; scope.requestConnection = function () { scope.newConnection = true; } scope.innerCallback = function (success, message) { scope.newConnection = false; if (success) { scope.confirmText = message; if (scope.callback) { scope.callback(); } } } } }; }; })();