summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/ds2-modal/modalService.js
blob: 061d1ba2608d8cacd728610a8f7864dc9435fa1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
angular.module("modalServices",[]).service('modalService', ['$modal', function ($modal) {
	var ModalInstanceCtrl = function ($scope, $modalInstance, items,$rootScope) {
		$scope.roleFun=items;
		$scope.msg=items;
		
	    $scope.cancel = function () {
	        $modalInstance.dismiss('cancel');
	    };
	};
	this.errorPopUp = function (msg) {
    	var modalInstance = $modal.open({
			templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html',
			controller: ModalInstanceCtrl,
			sizeClass: 'modal-small',
			resolve: {
                items: function () {
                    return msg;
                }
	        }
		});
    };
    this.successPopUp = function (msg) {
    	var modalInstance = $modal.open({
			templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html',
			controller: ModalInstanceCtrl,
			sizeClass: 'modal-small',
			resolve: {
				items: function () {
					var message = {
							title:    '',
	                   		text:     msg
	                };
					return message;			        	
                }
	        }
		});
    };
 }]);