Commit 039ef7d52b693590a3429bc8f19d714be1999df8
1 parent
d881022791
Exists in
master
primer búsqueda sucede en promesa cumplida
Showing
2 changed files
with
3 additions
and
5 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -17,10 +17,10 @@ angular.module('focaModalVendedores') |
| 17 | 17 | $scope.selectedVendedor = -1; |
| 18 | 18 | |
| 19 | 19 | $scope.busquedaPress = function(key) { |
| 20 | - if (key === 13) { | |
| 21 | - $scope.primerBusqueda = true; | |
| 20 | + if (key === 13) { | |
| 22 | 21 | focaVendedoresService.getVendedores($scope.filters).then( |
| 23 | 22 | function(res) { |
| 23 | + $scope.primerBusqueda = true; | |
| 24 | 24 | $scope.vendedores = res.data; |
| 25 | 25 | $scope.search(); |
| 26 | 26 | primera(); |
src/views/modal-vendedores.html
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | </tr> |
| 30 | 30 | </thead> |
| 31 | 31 | <tbody> |
| 32 | - <tr ng-show="currentPageVendedores.length == 0"> | |
| 32 | + <tr ng-show="currentPageVendedores.length == 0 && primerBusqueda"> | |
| 33 | 33 | <td colspan="3"> |
| 34 | 34 | No se encontraron resultados. |
| 35 | 35 | </td> |
| ... | ... | @@ -84,8 +84,6 @@ |
| 84 | 84 | </li> |
| 85 | 85 | </ul> |
| 86 | 86 | </nav> |
| 87 | - | |
| 88 | - | |
| 89 | 87 | </div> |
| 90 | 88 | <div class="modal-footer py-1"> |
| 91 | 89 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |