From cb3fcc1fe6726c030730428d3a080eadc5ab88e2 Mon Sep 17 00:00:00 2001 From: mpuebla Date: Wed, 21 Aug 2019 12:39:07 -0300 Subject: [PATCH] Agregado init para limpiar carrito despues de 30 segundos. --- .../components/cancelar-compra/cancelar-compra.component.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/components/cancelar-compra/cancelar-compra.component.ts b/src/app/components/cancelar-compra/cancelar-compra.component.ts index 2d9ba68..b0a9b44 100644 --- a/src/app/components/cancelar-compra/cancelar-compra.component.ts +++ b/src/app/components/cancelar-compra/cancelar-compra.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { appSettings } from 'src/etc/AppSettings'; import { Location } from '@angular/common'; import { Router } from '@angular/router'; +import { ProductoService } from 'src/app/services/producto.service'; @Component({ selector: 'app-cancelar-compra', @@ -14,10 +15,15 @@ export class CancelarCompraComponent implements OnInit { constructor( private location: Location, - private router: Router + private router: Router, + private productoService : ProductoService ) { } ngOnInit() { + + setTimeout(() => { + this.limpiarCarritoYvolver(); + }, 30000) } volverPreviousPage() { @@ -27,6 +33,9 @@ export class CancelarCompraComponent implements OnInit { limpiarCarritoYvolver(){ + this.productoService.productoAcargar = undefined; + this.productoService.promoAcargar = undefined; + this.productoService.productos = []; this.router.navigate(['/home']); } -- 1.9.1