-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodal.service.js
89 lines (75 loc) · 2.22 KB
/
modal.service.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
(function() {
'use strict';
angular.module('appName')
.service('modalService', function($uibModal) {
return {
popupModal: function(modalMessageObject) {
$uibModal.open({
templateUrl: 'app/popup/popup.html',
controller: 'testModalCtrl',
backdrop: 'static',
keyboard: false,
resolve: {
popupMessage: function() {
return modalMessageObject;
}
}
});
},
welcomeJobSeeker: function() {
$uibModal.open({
templateUrl:'app/popup/welcomeJobSeeker.html',
controller: 'WelcomePopUpController',
backdrop: 'static',
keyboard: false
});
},
welcomeRecruiter: function() {
$uibModal.open({
templateUrl:'app/popup/welcomeRecruiter.html',
controller: 'WelcomePopUpController',
backdrop: 'static',
keyboard: false
});
}
};
})
.controller('welcomeModalController',function($scope, $rootScope, $uibModalInstance) {
$scope.btnClickOK = function() {
$rootScope.firstLoginType = null;
$uibModalInstance.close();
}
})
.controller('modalController',['$scope','$uibModalInstance','popupMessage',function($scope, $uibModalInstance, popupMessage) {
$scope.config = {
header:'',
body:'',
btnOneName:'',
btnTwoName:'',
btnOneClick:'function',
btnTwoClick:'function'
}
$scope.config.header = popupMessage.header;
$scope.config.body = popupMessage.body;
$scope.config.btnOneName = popupMessage.btnOneName;
if (popupMessage.btnTwoName === undefined) {
$scope.secondButton = false;
}
else {
$scope.secondButton = true;
$scope.config.btnTwoName = popupMessage.btnTwoName;
}
$scope.btnOneClick = function() {
if(typeof popupMessage.btnOneClick === 'function') {
popupMessage.btnOneClick();
}
$uibModalInstance.close();
}
$scope.btnTwoClick = function() {
if(typeof popupMessage.btnTwoClick === 'function') {
popupMessage.btnTwoClick();
}
$uibModalInstance.close();
}
}])
})();