Commit 42ea0d5581058b61ebdc03f0e8177139ea4b1e0e
1 parent
5b653cdb33
Exists in
develop
Add
Boton para eliminar articulo en el carrito en pantalla de seleccion de articulo
Showing
3 changed files
with
18 additions
and
0 deletions
Show diff stats
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
... | ... | @@ -177,6 +177,10 @@ |
177 | 177 | *ngFor="let articulo of articuloService.carrito; let i = index;"> |
178 | 178 | <div class="swing-in-top-fwd"> |
179 | 179 | <img |
180 | + class="btn-effect icon-20 position-absolute right-0" | |
181 | + src="assets/img/icono-cancelar-color.svg" | |
182 | + (click)="deleteArticulo(i)"> | |
183 | + <img | |
180 | 184 | draggable="false" |
181 | 185 | ondragstart="return false;" |
182 | 186 | (contextmenu)="false" |
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
... | ... | @@ -154,6 +154,12 @@ export class SeleccionArticulosComponent implements OnInit, OnDestroy { |
154 | 154 | }); |
155 | 155 | } |
156 | 156 | |
157 | + | |
158 | + deleteArticulo(index: number) { | |
159 | + this.articuloService.carrito.splice(index, 1); | |
160 | + this.articuloService.calcularTotal(); | |
161 | + } | |
162 | + | |
157 | 163 | increaseShow() { |
158 | 164 | this.showQuantity += 100; |
159 | 165 | } |