Commit f5e403365cc7086f99bb05e0cd8daede50d53a2c
1 parent
ef028abf9d
Exists in
master
and in
1 other branch
Borrado console.log
Showing
1 changed file
with
0 additions
and
1 deletions
Show diff stats
src/js/controller.js
1 | angular.module('focaModalFormaPago') | 1 | angular.module('focaModalFormaPago') |
2 | .controller('focaModalFormaPagoController', [ | 2 | .controller('focaModalFormaPagoController', [ |
3 | '$timeout', '$filter', '$scope', '$uibModal', | 3 | '$timeout', '$filter', '$scope', '$uibModal', |
4 | '$uibModalInstance', 'focaModalFormaPagoService', | 4 | '$uibModalInstance', 'focaModalFormaPagoService', |
5 | function ($timeout, $filter, $scope, $uibModal, | 5 | function ($timeout, $filter, $scope, $uibModal, |
6 | $uibModalInstance, focaModalFormaPagoService) { | 6 | $uibModalInstance, focaModalFormaPagoService) { |
7 | 7 | ||
8 | //#region Variables | 8 | //#region Variables |
9 | $scope.botones = []; | 9 | $scope.botones = []; |
10 | //#endregion | 10 | //#endregion |
11 | 11 | ||
12 | init(); | 12 | init(); |
13 | 13 | ||
14 | function init() { | 14 | function init() { |
15 | $scope.botones = focaModalFormaPagoService.getBotonera(); | 15 | $scope.botones = focaModalFormaPagoService.getBotonera(); |
16 | console.log($scope.botones); | ||
17 | } | 16 | } |
18 | 17 | ||
19 | $scope.seleccionarContado = function () { | 18 | $scope.seleccionarContado = function () { |
20 | var modalInstance = abrirModal('modal-tarjetas.html', | 19 | var modalInstance = abrirModal('modal-tarjetas.html', |
21 | 'focaModalTarjetasController'); | 20 | 'focaModalTarjetasController'); |
22 | modalInstance.result | 21 | modalInstance.result |
23 | .then(function (data) { | 22 | .then(function (data) { |
24 | console.log(data); | 23 | console.log(data); |
25 | }) | 24 | }) |
26 | .catch(function (e) { console.error(e); }); | 25 | .catch(function (e) { console.error(e); }); |
27 | }; | 26 | }; |
28 | 27 | ||
29 | $scope.seleccionarTarjetas = function () { | 28 | $scope.seleccionarTarjetas = function () { |
30 | var modalInstance = abrirModal('modal-tarjetas.html', | 29 | var modalInstance = abrirModal('modal-tarjetas.html', |
31 | 'focaModalTarjetasController'); | 30 | 'focaModalTarjetasController'); |
32 | modalInstance.result | 31 | modalInstance.result |
33 | .then(function (data) { | 32 | .then(function (data) { |
34 | $uibModalInstance.close(data); | 33 | $uibModalInstance.close(data); |
35 | }) | 34 | }) |
36 | .catch(function (e) { console.error(e); }); | 35 | .catch(function (e) { console.error(e); }); |
37 | }; | 36 | }; |
38 | 37 | ||
39 | $scope.seleccionarCheque = function () { | 38 | $scope.seleccionarCheque = function () { |
40 | var modalInstance = abrirModal('modal-tarjetas.html', | 39 | var modalInstance = abrirModal('modal-tarjetas.html', |
41 | 'focaModalTarjetasController'); | 40 | 'focaModalTarjetasController'); |
42 | modalInstance.result | 41 | modalInstance.result |
43 | .then(function (data) { | 42 | .then(function (data) { |
44 | console.log(data); | 43 | console.log(data); |
45 | }) | 44 | }) |
46 | .catch(function (e) { console.error(e); }); | 45 | .catch(function (e) { console.error(e); }); |
47 | }; | 46 | }; |
48 | 47 | ||
49 | $scope.seleccionarVales = function () { | 48 | $scope.seleccionarVales = function () { |
50 | var modalInstance = abrirModal('modal-tarjetas.html', | 49 | var modalInstance = abrirModal('modal-tarjetas.html', |
51 | 'focaModalTarjetasController'); | 50 | 'focaModalTarjetasController'); |
52 | modalInstance.result | 51 | modalInstance.result |
53 | .then(function (data) { | 52 | .then(function (data) { |
54 | console.log(data); | 53 | console.log(data); |
55 | }) | 54 | }) |
56 | .catch(function (e) { console.error(e); }); | 55 | .catch(function (e) { console.error(e); }); |
57 | }; | 56 | }; |
58 | 57 | ||
59 | $scope.seleccionarPagoElectronico = function () { | 58 | $scope.seleccionarPagoElectronico = function () { |
60 | var modalInstance = abrirModal('modal-tarjetas.html', | 59 | var modalInstance = abrirModal('modal-tarjetas.html', |
61 | 'focaModalTarjetasController'); | 60 | 'focaModalTarjetasController'); |
62 | modalInstance.result | 61 | modalInstance.result |
63 | .then(function (data) { | 62 | .then(function (data) { |
64 | console.log(data); | 63 | console.log(data); |
65 | }) | 64 | }) |
66 | .catch(function (e) { console.error(e); }); | 65 | .catch(function (e) { console.error(e); }); |
67 | }; | 66 | }; |
68 | 67 | ||
69 | function abrirModal(templateUrl, controller) { | 68 | function abrirModal(templateUrl, controller) { |
70 | return $uibModal.open( | 69 | return $uibModal.open( |
71 | { | 70 | { |
72 | templateUrl: templateUrl, | 71 | templateUrl: templateUrl, |
73 | controller: controller, | 72 | controller: controller, |
74 | resolve: { | 73 | resolve: { |
75 | filters: function () { return null; }, | 74 | filters: function () { return null; }, |
76 | }, | 75 | }, |
77 | size: 'lg', | 76 | size: 'lg', |
78 | } | 77 | } |
79 | ); | 78 | ); |
80 | 79 | ||
81 | } | 80 | } |
82 | 81 | ||
83 | $scope.cancel = function () { | 82 | $scope.cancel = function () { |
84 | $uibModalInstance.dismiss('cancel'); | 83 | $uibModalInstance.dismiss('cancel'); |
85 | }; | 84 | }; |
86 | }] | 85 | }] |
87 | ) | 86 | ) |
88 | .controller('focaModalTarjetasController', [ | 87 | .controller('focaModalTarjetasController', [ |
89 | '$timeout', '$filter', '$scope', '$uibModalInstance', 'focaModalTarjetasService', | 88 | '$timeout', '$filter', '$scope', '$uibModalInstance', 'focaModalTarjetasService', |
90 | function ($timeout, $filter, $scope, $uibModalInstance, focaModalTarjetasService) { | 89 | function ($timeout, $filter, $scope, $uibModalInstance, focaModalTarjetasService) { |
91 | 90 | ||
92 | //#region Variables | 91 | //#region Variables |
93 | $scope.botonesTarjetas = []; | 92 | $scope.botonesTarjetas = []; |
94 | $scope.showForm = false; | 93 | $scope.showForm = false; |
95 | 94 | ||
96 | //#endregion | 95 | //#endregion |
97 | 96 | ||
98 | init(); | 97 | init(); |
99 | 98 | ||
100 | function init() { | 99 | function init() { |
101 | $scope.botonesTarjetas = focaModalTarjetasService.getBotonera(); | 100 | $scope.botonesTarjetas = focaModalTarjetasService.getBotonera(); |
102 | } | 101 | } |
103 | 102 | ||
104 | $scope.seleccionarTarjeta = function () { | 103 | $scope.seleccionarTarjeta = function () { |
105 | animateForm(); | 104 | animateForm(); |
106 | }; | 105 | }; |
107 | 106 | ||
108 | $scope.cancel = function () { | 107 | $scope.cancel = function () { |
109 | $uibModalInstance.dismiss('cancel'); | 108 | $uibModalInstance.dismiss('cancel'); |
110 | }; | 109 | }; |
111 | 110 | ||
112 | $scope.aceptarFormaDePago = function () { | 111 | $scope.aceptarFormaDePago = function () { |
113 | $uibModalInstance.close('data de tarjeta'); | 112 | $uibModalInstance.close('data de tarjeta'); |
114 | }; | 113 | }; |
115 | 114 | ||
116 | function animateForm() { | 115 | function animateForm() { |
117 | $scope.showForm = false; | 116 | $scope.showForm = false; |
118 | $timeout(function () { | 117 | $timeout(function () { |
119 | $scope.showForm = true; | 118 | $scope.showForm = true; |
120 | }, 100); | 119 | }, 100); |
121 | } | 120 | } |
122 | }] | 121 | }] |
123 | ); | 122 | ); |
124 | 123 |