1 angular.module("modalServices",[]).service('modalService', ['$modal', function ($modal) {
4 this.showSuccess = function(heading, messageBody){
5 var modalInstance = $modal.open({
6 templateUrl: 'modal_informative.html',
7 controller: 'modalpopupController',
10 $(".overlayed").css("display","none");
11 $(".loadingId").css("display","none");
21 this.showFailure = function(heading, messageBody){
22 var modalInstance = $modal.open({
23 templateUrl: 'modal_warning.html',
24 controller: 'modalpopupController',
26 message: function () {
37 this.showMessage = function(heading, messageBody){
38 var modalInstance = $modal.open({
39 templateUrl: 'modal_message.html',
40 controller: 'modalpopupController',
42 message: function () {
53 this.showWarning = function(heading, messageBody){
54 var modalInstance = $modal.open({
55 templateUrl: 'modal_warning_message.html',
56 controller: 'modalpopupController',
58 message: function () {
69 this.popupConfirmWin = function(title, msgBody, callback){
70 var modalInstance = $modal.open({
71 templateUrl: 'confirmation_informative.html',
72 controller: 'modalpopupController',
74 message: function () {
83 var args = Array.prototype.slice.call( arguments, 0 );
85 modalInstance.result.then(function(){
86 callback.apply(null, args);
88 })['finally'](function(){
89 modalInstance = undefined;
93 this.popupConfirmWinWithCancel = function(title, msgBody, callback,dismissCallback){
94 var modalInstance = $modal.open({
95 templateUrl: 'confirmation_informative.html',
96 controller: 'modalpopupController',
98 message: function () {
107 var args = Array.prototype.slice.call( arguments, 0 );
109 modalInstance.result.then(function(){
110 callback.apply(null, args);
113 })['finally'](function(){
114 modalInstance = undefined;
118 this.popupDeleteConfirmWin = function(title, msgBody, callback, argForCallBack){
119 var modalInstance = $modal.open({
120 templateUrl: 'confirmation_for_delete.html',
121 controller: 'modalpopupController',
123 message: function () {
133 modalInstance.result.then(function(){
134 callback(argForCallBack);
136 })['finally'](function(){
137 modalInstance = undefined;
142 this.popupSuccessRedirectWin = function(title, msgBody, redirectUrl){
143 var modalInstance = $modal.open({
144 templateUrl: 'modal_informative.html',
145 controller: 'modalpopupController',
147 message: function () {
156 modalInstance.result.then(function() {
158 window.location.href=redirectUrl;
159 })['finally'](function(){
160 modalInstance = undefined;
164 this.popupWarningRedirectWin = function(title, msgBody, redirectUrl){
165 var modalInstance = $modal.open({
166 templateUrl: 'modal_warning_message.html',
167 controller: 'modalpopupController',
169 message: function () {
178 modalInstance.result.then(function() {
180 window.location.href=redirectUrl;
181 })['finally'](function(){
182 modalInstance = undefined;