diff --git a/src/app/components/busqueda-productos/busqueda-productos.component.html b/src/app/components/busqueda-productos/busqueda-productos.component.html
index 0797032..dce5c26 100644
--- a/src/app/components/busqueda-productos/busqueda-productos.component.html
+++ b/src/app/components/busqueda-productos/busqueda-productos.component.html
@@ -20,6 +20,12 @@
-
+ Todos
+
+ - {
this.categorias = categorias;
- this.categoriaActive = this.verCategorias ? 1 : categorias[0].id;
+ this.categoriaActive = this.verCategorias ? 0 : categorias[0].id;
});
this.productoService.productoAcargar = undefined;
@@ -51,8 +51,11 @@ export class BusquedaProductosComponent implements OnInit {
filterItems() {
this.auxProductos = this.productos.filter(x => {
- return x.DetArt.toLowerCase().includes(this.searchTerm.toLowerCase()) &&
- x.categoria_selfservice == this.categoriaActive;
+ if (this.categoriaActive === 0)
+ return x.DetArt.toLowerCase().includes(this.searchTerm.toLowerCase())
+ else
+ return x.DetArt.toLowerCase().includes(this.searchTerm.toLowerCase()) &&
+ x.categoria_selfservice === this.categoriaActive;
});
}
@@ -80,7 +83,7 @@ export class BusquedaProductosComponent implements OnInit {
},
error => { console.error(error); }
);
- }else {
+ } else {
this.productoService.productoAcargar = producto;
this.router.navigate(['inicio']);