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