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.showWarning = function(heading, messageBody){
38 var modalInstance = $modal.open({
39 templateUrl: 'modal_warning_message.html',
40 controller: 'modalpopupController',
42 message: function () {
53 this.popupConfirmWin = function(title, msgBody, callback,dismissCallback){
54 var modalInstance = $modal.open({
55 templateUrl: 'confirmation_informative.html',
56 controller: 'modalpopupController',
58 message: function () {
67 var args = Array.prototype.slice.call( arguments, 0 );
69 modalInstance.result.then(function(){
70 callback.apply(null, args);
72 })['finally'](function(){
73 modalInstance = undefined;
77 this.popupConfirmWinWithCancel = function(title, msgBody, callback,dismissCallback){
78 var modalInstance = $modal.open({
79 templateUrl: 'confirmation_informative.html',
80 controller: 'modalpopupController',
82 message: function () {
91 var args = Array.prototype.slice.call( arguments, 0 );
93 modalInstance.result.then(function(){
94 callback.apply(null, args);
97 })['finally'](function(){
98 modalInstance = undefined;
102 this.popupDeleteConfirmWin = function(title, msgBody, callback, argForCallBack){
103 var modalInstance = $modal.open({
104 templateUrl: 'confirmation_for_delete.html',
105 controller: 'modalpopupController',
107 message: function () {
117 modalInstance.result.then(function(){
118 callback(argForCallBack);
120 })['finally'](function(){
121 modalInstance = undefined;
126 this.popupSuccessRedirectWin = function(title, msgBody, redirectUrl){
127 var modalInstance = $modal.open({
128 templateUrl: 'modal_informative.html',
129 controller: 'modalpopupController',
131 message: function () {
140 modalInstance.result.then(function() {
142 window.location.href=redirectUrl;
143 })['finally'](function(){
144 modalInstance = undefined;
148 this.popupWarningRedirectWin = function(title, msgBody, redirectUrl){
149 var modalInstance = $modal.open({
150 templateUrl: 'modal_warning_message.html',
151 controller: 'modalpopupController',
153 message: function () {
162 modalInstance.result.then(function() {
164 window.location.href=redirectUrl;
165 })['finally'](function(){
166 modalInstance = undefined;