Commit cb3fcc1fe6726c030730428d3a080eadc5ab88e2
1 parent
c85fe3e41b
Exists in
master
and in
1 other branch
Agregado init para limpiar carrito despues de 30 segundos.
Showing
1 changed file
with
10 additions
and
1 deletions
Show diff stats
src/app/components/cancelar-compra/cancelar-compra.component.ts
| ... | ... | @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; |
| 2 | 2 | import { appSettings } from 'src/etc/AppSettings'; |
| 3 | 3 | import { Location } from '@angular/common'; |
| 4 | 4 | import { Router } from '@angular/router'; |
| 5 | +import { ProductoService } from 'src/app/services/producto.service'; | |
| 5 | 6 | |
| 6 | 7 | @Component({ |
| 7 | 8 | selector: 'app-cancelar-compra', |
| ... | ... | @@ -14,10 +15,15 @@ export class CancelarCompraComponent implements OnInit { |
| 14 | 15 | |
| 15 | 16 | constructor( |
| 16 | 17 | private location: Location, |
| 17 | - private router: Router | |
| 18 | + private router: Router, | |
| 19 | + private productoService : ProductoService | |
| 18 | 20 | ) { } |
| 19 | 21 | |
| 20 | 22 | ngOnInit() { |
| 23 | + | |
| 24 | + setTimeout(() => { | |
| 25 | + this.limpiarCarritoYvolver(); | |
| 26 | + }, 30000) | |
| 21 | 27 | } |
| 22 | 28 | |
| 23 | 29 | volverPreviousPage() { |
| ... | ... | @@ -27,6 +33,9 @@ export class CancelarCompraComponent implements OnInit { |
| 27 | 33 | |
| 28 | 34 | limpiarCarritoYvolver(){ |
| 29 | 35 | |
| 36 | + this.productoService.productoAcargar = undefined; | |
| 37 | + this.productoService.promoAcargar = undefined; | |
| 38 | + this.productoService.productos = []; | |
| 30 | 39 | this.router.navigate(['/home']); |
| 31 | 40 | } |
| 32 | 41 |