diff --git a/src/app/components/sidebar/sidebar.component.ts b/src/app/components/sidebar/sidebar.component.ts index 5281245..5c6b5d1 100644 --- a/src/app/components/sidebar/sidebar.component.ts +++ b/src/app/components/sidebar/sidebar.component.ts @@ -43,7 +43,7 @@ export class SidebarComponent implements OnInit { constructor() { } ngOnInit() { - + this.getCantidadProductos(); this.getTotal(); @@ -103,7 +103,7 @@ export class SidebarComponent implements OnInit { deleteProducto(index) { - for (let i = 0; i < this.productos.length; i++){ + for (let i = 0; i < this.productos.length; i++) { if (i === index) { this.cont -= this.productos[i].cantidad; //Elimina del total el precio de todo el item @@ -114,11 +114,10 @@ export class SidebarComponent implements OnInit { } } - clearCar(){ - let arr = []; - this.productos = arr; + clearCar() { + + this.productos = []; this.total = 0; this.cont = 0; } - }