Commit 70f4dec40e04b6c0276a1e5179f78e039bedb755
1 parent
156e4de0b8
Exists in
master
and in
1 other branch
Agregado metodo para limpiar carrito.
Showing
2 changed files
with
18 additions
and
5 deletions
Show diff stats
src/app/components/cancelar-compra/cancelar-compra.component.html
| 1 | -<div class="container-fluid background-image"> | |
| 2 | - <div class="row"> | |
| 1 | +<div class="container-fluid p-0 background-image"> | |
| 2 | + <div class="row m-0"> | |
| 3 | 3 | <div class="col p-0"> |
| 4 | - <div class="vh-100 d-flex align-content-strech flex-wrap disable-user-select"> | |
| 4 | + <div class="vh-100 fade-in d-flex align-content-strech flex-wrap disable-user-select"> | |
| 5 | 5 | |
| 6 | 6 | <!-- HEADER --> |
| 7 | 7 | <div class="row m-0 w-100 bg-primary-gradient-horizontal"> |
| ... | ... | @@ -45,7 +45,10 @@ |
| 45 | 45 | <span class="pr-2">Volver a mi compra</span> |
| 46 | 46 | <i class="fa fa-undo text-warning"></i> |
| 47 | 47 | </button> |
| 48 | - <button type="button" class="btn btn-lg btn-light shadow ml-4"> | |
| 48 | + <button | |
| 49 | + type="button" | |
| 50 | + class="btn btn-lg btn-light shadow ml-4" | |
| 51 | + (click)="limpiarCarritoYvolver()"> | |
| 49 | 52 | <span class="pr-2">Si, terminar</span> |
| 50 | 53 | <i class="fa fa-times text-danger"></i> |
| 51 | 54 | </button> |
src/app/components/cancelar-compra/cancelar-compra.component.ts
| 1 | 1 | import { Component, OnInit } from '@angular/core'; |
| 2 | 2 | import { appSettings } from 'src/etc/AppSettings'; |
| 3 | 3 | import { Location } from '@angular/common'; |
| 4 | +import { Router } from '@angular/router'; | |
| 4 | 5 | |
| 5 | 6 | @Component({ |
| 6 | 7 | selector: 'app-cancelar-compra', |
| ... | ... | @@ -11,13 +12,22 @@ export class CancelarCompraComponent implements OnInit { |
| 11 | 12 | |
| 12 | 13 | private apiUrl: string = appSettings.apiUrl; |
| 13 | 14 | |
| 14 | - constructor(private location: Location) { } | |
| 15 | + constructor( | |
| 16 | + private location: Location, | |
| 17 | + private router: Router | |
| 18 | + ) { } | |
| 15 | 19 | |
| 16 | 20 | ngOnInit() { |
| 17 | 21 | } |
| 18 | 22 | |
| 19 | 23 | volverPreviousPage() { |
| 24 | + | |
| 20 | 25 | this.location.back(); |
| 21 | 26 | } |
| 22 | 27 | |
| 28 | + limpiarCarritoYvolver(){ | |
| 29 | + | |
| 30 | + this.router.navigate(['/home']); | |
| 31 | + } | |
| 32 | + | |
| 23 | 33 | } |