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){
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.popupDeleteConfirmWin = function(title, msgBody, callback, argForCallBack){
78 var modalInstance = $modal.open({
79 templateUrl: 'confirmation_for_delete.html',
80 controller: 'modalpopupController',
82 message: function () {
92 modalInstance.result.then(function(){
93 callback(argForCallBack);
95 })['finally'](function(){
96 modalInstance = undefined;
101 this.popupSuccessRedirectWin = function(title, msgBody, redirectUrl){
102 var modalInstance = $modal.open({
103 templateUrl: 'modal_informative.html',
104 controller: 'modalpopupController',
106 message: function () {
115 modalInstance.result.then(function() {
117 window.location.href=redirectUrl;
118 })['finally'](function(){
119 modalInstance = undefined;
123 this.popupWarningRedirectWin = function(title, msgBody, redirectUrl){
124 var modalInstance = $modal.open({
125 templateUrl: 'modal_warning_message.html',
126 controller: 'modalpopupController',
128 message: function () {
137 modalInstance.result.then(function() {
139 window.location.href=redirectUrl;
140 })['finally'](function(){
141 modalInstance = undefined;