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