Commit 12a90405f89a454ceb81e4b2e0b13e2b35f24323
1 parent
f52b8fb0ee
Exists in
master
Arreglo para agregar(push) y borrar productos del carrito.
Showing
3 changed files
with
3 additions
and
3 deletions
Show diff stats
src/app/components/sidebar/sidebar.component.html
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <div class="overflow-scroll px-1 mb-1 w-100"> |
10 | 10 | <!-- PRODUCTOS CARRITO --> |
11 | 11 | <div class="row m-0" |
12 | - *ngFor="let producto of productosCarrito"> | |
12 | + *ngFor="let producto of productosCarrito; let i = index"> | |
13 | 13 | <div class="col p-0 my-1 bg-white border-0 rounded-sm"> |
14 | 14 | <div class="row m-0"> |
15 | 15 | <div class="col-6 pl-1 pr-0 my-auto"> |
src/app/components/sidebar/sidebar.component.ts
... | ... | @@ -73,7 +73,7 @@ export class SidebarComponent implements OnInit { |
73 | 73 | |
74 | 74 | this.cantTotal -= producto.cantidad; |
75 | 75 | this.total -= producto.PreVen * producto.cantidad; |
76 | - this.productosCarrito.reverse().splice(index, 1); | |
76 | + this.productosCarrito.splice(index, 1); | |
77 | 77 | return; |
78 | 78 | } |
79 | 79 |
src/app/services/producto.service.ts