From 8c088fc687f4bcbac401f1e6f08be8df052888ec Mon Sep 17 00:00:00 2001 From: Pablo Marco del Pont Date: Wed, 3 Oct 2018 16:32:41 -0300 Subject: [PATCH] =?UTF-8?q?-=20Modifiqu=C3=A9=20gulp=20para=20que=20uglifi?= =?UTF-8?q?que=20despues=20de=20generar=20templates.=20-=20Agregu=C3=A9=20?= =?UTF-8?q?m=C3=A9todo=20para=20procesar=20el=20cliente=20seleccionado.=20?= =?UTF-8?q?-=20Agregu=C3=A9=20on=20select=20al=20componente=20typeahead.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 4 +--- src/js/controller.js | 11 ++++++++--- src/views/foca-busqueda-cliente-modal.html | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 516bdfc..14f7bac 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -28,7 +28,7 @@ gulp.task('templates', function() { ); }); -gulp.task('uglify', function() { +gulp.task('uglify', ['templates'], function() { pump( [ gulp.src([ @@ -54,5 +54,3 @@ gulp.task('pre-commit', function() { ] ); }); - -gulp.task('compile', ['templates', 'uglify']); diff --git a/src/js/controller.js b/src/js/controller.js index e1bcdf4..7294a18 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -9,6 +9,8 @@ angular.module('focaBusquedaCliente') templateUrl: 'foca-busqueda-cliente-modal.html', backdrop: false, controller: 'focaBusquedaClienteModalController' + }).result.then(function(cliente){ + console.log(cliente); }); }; } @@ -25,11 +27,14 @@ angular.module('focaBusquedaCliente') return datos.data; }); }; + $scope.seleccionar = function(cliente) { + $scope.cliente = cliente; + }; $scope.cancelar = function() { - $uibModalInstance.close(); + $uibModalInstance.dismiss(); }; - $scope.seleccionar = function() { - $uibModalInstance.close(); + $scope.aceptar = function() { + $uibModalInstance.close($scope.cliente); }; } ]); diff --git a/src/views/foca-busqueda-cliente-modal.html b/src/views/foca-busqueda-cliente-modal.html index b57dfe2..8e7782c 100644 --- a/src/views/foca-busqueda-cliente-modal.html +++ b/src/views/foca-busqueda-cliente-modal.html @@ -18,6 +18,7 @@ typeahead-loading="cargandoClientes" typeahead-no-results="sinResultados" typeahead-min-length="3" + typeahead-on-select="seleccionar($item)" class="form-control" > @@ -29,6 +30,6 @@ -- 1.9.1