Commit 05178cd950a4b54bbf95bb737a8fffd7f8c371d0
1 parent
fc0db6803c
Exists in
master
punto y coma
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
src/js/service.js
| 1 | angular.module('focaModal') | 1 | angular.module('focaModal') |
| 2 | .service('focaModalService', [ | 2 | .service('focaModalService', [ |
| 3 | '$uibModal', 'API_ENDPOINT', '$http', | 3 | '$uibModal', 'API_ENDPOINT', '$http', |
| 4 | function($uibModal, API_ENDPOINT, $http) { | 4 | function($uibModal, API_ENDPOINT, $http) { |
| 5 | return { | 5 | return { |
| 6 | confirm: function(textoModal) { | 6 | confirm: function(textoModal) { |
| 7 | return $uibModal.open({ | 7 | return $uibModal.open({ |
| 8 | templateUrl: 'modal-confirm.html', | 8 | templateUrl: 'modal-confirm.html', |
| 9 | controller: 'focaModalConfirmController', | 9 | controller: 'focaModalConfirmController', |
| 10 | animation: false, | 10 | animation: false, |
| 11 | backdrop: false, | 11 | backdrop: false, |
| 12 | resolve: { textoModal: function() { return textoModal; } } | 12 | resolve: { textoModal: function() { return textoModal; } } |
| 13 | }) | 13 | }) |
| 14 | .result.then( | 14 | .result.then( |
| 15 | function(resultado) { | 15 | function(resultado) { |
| 16 | return resultado; | 16 | return resultado; |
| 17 | } | 17 | } |
| 18 | ); | 18 | ); |
| 19 | }, | 19 | }, |
| 20 | alert: function(textoModal) { | 20 | alert: function(textoModal) { |
| 21 | return $uibModal.open({ | 21 | return $uibModal.open({ |
| 22 | templateUrl: 'modal-alert.html', | 22 | templateUrl: 'modal-alert.html', |
| 23 | controller: 'focaModalAlertController', | 23 | controller: 'focaModalAlertController', |
| 24 | animation: false, | 24 | animation: false, |
| 25 | backdrop: false, | 25 | backdrop: false, |
| 26 | resolve: { textoModal: function() { return textoModal; } } | 26 | resolve: { textoModal: function() { return textoModal; } } |
| 27 | }) | 27 | }) |
| 28 | .result.then( | 28 | .result.then( |
| 29 | function(resultado) { | 29 | function(resultado) { |
| 30 | return resultado; | 30 | return resultado; |
| 31 | } | 31 | } |
| 32 | ) | 32 | ); |
| 33 | }, | 33 | }, |
| 34 | modal: function(columnas, query, titulo) { | 34 | modal: function(columnas, query, titulo) { |
| 35 | return $uibModal.open({ | 35 | return $uibModal.open({ |
| 36 | templateUrl: 'foca-modal.html', | 36 | templateUrl: 'foca-modal.html', |
| 37 | controller: 'focaModalController', | 37 | controller: 'focaModalController', |
| 38 | size: 'lg', | 38 | size: 'lg', |
| 39 | resolve: { | 39 | resolve: { |
| 40 | columnas: function() { return columnas; }, | 40 | columnas: function() { return columnas; }, |
| 41 | query: function() { return query; }, | 41 | query: function() { return query; }, |
| 42 | titulo: function() {return titulo;} | 42 | titulo: function() {return titulo;} |
| 43 | } | 43 | } |
| 44 | }) | 44 | }) |
| 45 | .result.then( | 45 | .result.then( |
| 46 | function(resultado) { | 46 | function(resultado) { |
| 47 | return resultado; | 47 | return resultado; |
| 48 | } | 48 | } |
| 49 | ) | 49 | ); |
| 50 | }, | 50 | }, |
| 51 | getEntidad: function(filters, query) { | 51 | getEntidad: function(filters, query) { |
| 52 | return $http.get(API_ENDPOINT.URL + query, {nombre: filters}); | 52 | return $http.get(API_ENDPOINT.URL + query, {nombre: filters}); |
| 53 | }, | 53 | }, |
| 54 | modalFecha: function(titulo) { | 54 | modalFecha: function(titulo) { |
| 55 | return $uibModal.open({ | 55 | return $uibModal.open({ |
| 56 | templateUrl: 'foca-fecha.html', | 56 | templateUrl: 'foca-fecha.html', |
| 57 | controller: 'focaModalFechaController', | 57 | controller: 'focaModalFechaController', |
| 58 | size: 'md', | 58 | size: 'md', |
| 59 | resolve: { | 59 | resolve: { |
| 60 | titulo: function() {return titulo;} | 60 | titulo: function() {return titulo;} |
| 61 | } | 61 | } |
| 62 | }) | 62 | }) |
| 63 | .result.then( | 63 | .result.then( |
| 64 | function(resultado) { | 64 | function(resultado) { |
| 65 | return resultado; | 65 | return resultado; |
| 66 | } | 66 | } |
| 67 | ) | 67 | ); |
| 68 | } | 68 | } |
| 69 | }; | 69 | }; |
| 70 | } | 70 | } |
| 71 | ]); | 71 | ]); |
| 72 | 72 |