Commit 957cd74950b902d93468ecaeed5ae568fa1b6386
Exists in
master
Merge branch 'master' into 'master'
Master(efernandez) See merge request modulos-npm/foca-modal-busqueda-productos!12
Showing
3 changed files
Show diff stats
index.html
src/js/controller.js
... | ... | @@ -21,19 +21,20 @@ angular.module('focaBusquedaProductos') |
21 | 21 | //METODOS |
22 | 22 | $scope.busquedaPress = function(key) { |
23 | 23 | if (key === 13) { |
24 | - $scope.primerBusqueda = true; | |
25 | - if(idLista) { | |
24 | + if(idLista > 0) { | |
26 | 25 | focaBusquedaProductosService |
27 | 26 | .getProductosByIdLista(idLista, $scope.filters) |
28 | 27 | .then( |
29 | 28 | function(res) { |
29 | + $scope.primerBusqueda = true; | |
30 | 30 | $scope.productos = res.data; |
31 | 31 | $scope.search(); |
32 | 32 | } |
33 | 33 | ); |
34 | - } else { | |
34 | + } else if(idLista === -1) { | |
35 | 35 | focaBusquedaProductosService.getProductos().then( |
36 | 36 | function(res) { |
37 | + $scope.primerBusqueda = true; | |
37 | 38 | $scope.productos = res.data; |
38 | 39 | $scope.search(); |
39 | 40 | primera(); |
src/views/modal-busqueda-productos.html