Commit 4ae1292d7432c0e4596a0c8a54794ab7f5f68635
1 parent
db0af85b13
Exists in
master
and in
1 other branch
Arreglos minimos
Showing
1 changed file
with
5 additions
and
6 deletions
Show diff stats
src/app/components/sidebar/sidebar.component.ts
| ... | ... | @@ -43,7 +43,7 @@ export class SidebarComponent implements OnInit { |
| 43 | 43 | constructor() { } |
| 44 | 44 | |
| 45 | 45 | ngOnInit() { |
| 46 | - | |
| 46 | + | |
| 47 | 47 | this.getCantidadProductos(); |
| 48 | 48 | this.getTotal(); |
| 49 | 49 | |
| ... | ... | @@ -103,7 +103,7 @@ export class SidebarComponent implements OnInit { |
| 103 | 103 | |
| 104 | 104 | deleteProducto(index) { |
| 105 | 105 | |
| 106 | - for (let i = 0; i < this.productos.length; i++){ | |
| 106 | + for (let i = 0; i < this.productos.length; i++) { | |
| 107 | 107 | if (i === index) { |
| 108 | 108 | this.cont -= this.productos[i].cantidad; |
| 109 | 109 | //Elimina del total el precio de todo el item |
| ... | ... | @@ -114,11 +114,10 @@ export class SidebarComponent implements OnInit { |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - clearCar(){ | |
| 118 | - let arr = []; | |
| 119 | - this.productos = arr; | |
| 117 | + clearCar() { | |
| 118 | + | |
| 119 | + this.productos = []; | |
| 120 | 120 | this.total = 0; |
| 121 | 121 | this.cont = 0; |
| 122 | 122 | } |
| 123 | - | |
| 124 | 123 | } |