6 .factory('confirmModal', confirmModal);
8 confirmModal.$inject = ['$uibModal'];
11 * Opens confirm modal dialog with input textbox
13 function confirmModal($uibModal) {
14 return function(text, successHandler) {
16 templateUrl: '/shared/alerts/confirmModal.html',
17 controller: 'CustomConfirmModalController as confirmModal',
23 successHandler: successHandler
33 .controller('CustomConfirmModalController',
34 CustomConfirmModalController);
36 CustomConfirmModalController.$inject = ['$uibModalInstance', 'data'];
39 * This is the controller for the alert pop-up.
41 function CustomConfirmModalController($uibModalInstance, data) {
44 ctrl.confirm = confirm;
47 ctrl.data = angular.copy(data);
50 * Initiate confirmation and call the success handler with the
54 $uibModalInstance.close();
55 if (angular.isDefined(ctrl.data.successHandler)) {
56 ctrl.data.successHandler(ctrl.inputText);
61 * Close the confirm modal without initiating changes.
64 $uibModalInstance.dismiss('cancel');