Commit a5ce8e802122de92238fc91294d0f51c0c53c421
1 parent
3b8523b23d
Exists in
master
Arreglo en imagen.
Showing
1 changed file
with
11 additions
and
5 deletions
Show diff stats
src/app/components/inicio/inicio.component.ts
... | ... | @@ -123,11 +123,17 @@ export class InicioComponent implements OnInit { |
123 | 123 | |
124 | 124 | promoSeleccionada($event: Producto) { |
125 | 125 | |
126 | - this.promoAcargar = $event; | |
127 | - if (this.promoAcargar.tieneSinonimos) { | |
128 | - var sector = this.promoAcargar.CodSec; | |
129 | - var codigo = this.promoAcargar.CodArt; | |
130 | - this.getSinonimos(sector, codigo); | |
126 | + if ($event.tieneSinonimos) { | |
127 | + | |
128 | + this.productoService.getProductoById($event.id) | |
129 | + .subscribe((res : Producto) => { | |
130 | + | |
131 | + $event.imagenes = res.imagenes; | |
132 | + this.promoAcargar = $event; | |
133 | + this.getSinonimos(this.promoAcargar.CodSec, this.promoAcargar.CodArt); | |
134 | + }, | |
135 | + error => { console.log(error); }) | |
136 | + | |
131 | 137 | |
132 | 138 | } else if (this.popoverDirective) { |
133 | 139 | this.popoverDirective.hide(); |