Commit fa6e2c0215b85b3ab1d62e441cb6421016e788bf
1 parent
aff73e1808
Exists in
develop
Arreglo en navegacion
Showing
5 changed files
with
17 additions
and
7 deletions
 
Show diff stats
src/app/app-routing.module.ts
| ... | ... | @@ -21,11 +21,11 @@ const routes: Routes = [ | 
| 21 | 21 | path: 'seleccion-articulos', | 
| 22 | 22 | loadChildren: () => import('./modules/seleccion-articulos/seleccion-articulos.module').then(m => m.SeleccionArticulosModule) | 
| 23 | 23 | }, | 
| 24 | + { | |
| 25 | + path: 'carrito', loadChildren: () => import('./modules/carrito/carrito.module').then(m => m.CarritoModule) | |
| 26 | + }, | |
| 24 | 27 | ] | 
| 25 | 28 | }, | 
| 26 | - { | |
| 27 | - path: 'carrito', loadChildren: () => import('./modules/carrito/carrito.module').then(m => m.CarritoModule) | |
| 28 | - }, | |
| 29 | 29 | { path: '**', redirectTo: '', pathMatch: 'full' }, | 
| 30 | 30 | ]; | 
| 31 | 31 | 
src/app/modules/carrito/carrito.component.html
| ... | ... | @@ -87,7 +87,7 @@ | 
| 87 | 87 | <div class="row mx-3 mt-2 h-auto justify-content-end"> | 
| 88 | 88 | <div | 
| 89 | 89 | class="col-auto py-2 px-3 align-self-center btn-effect bg-primary badge-pill text-white" | 
| 90 | - [routerLink]="['/seleccion-articulos']"> | |
| 90 | + (click)="goBack()"> | |
| 91 | 91 | <span> | 
| 92 | 92 | <small class="pr-2">SEGUIR COMPRANDO</small> | 
| 93 | 93 | <img class="icon-20" src="assets/img/ir.svg"> | 
src/app/modules/carrito/carrito.component.ts
| 1 | 1 | import { Component, OnInit } from '@angular/core'; | 
| 2 | +import { Location } from '@angular/common'; | |
| 2 | 3 | |
| 3 | 4 | @Component({ | 
| 4 | 5 | selector: 'app-carrito', | 
| ... | ... | @@ -7,9 +8,15 @@ import { Component, OnInit } from '@angular/core'; | 
| 7 | 8 | }) | 
| 8 | 9 | export class CarritoComponent implements OnInit { | 
| 9 | 10 | |
| 10 | - constructor() { } | |
| 11 | + constructor( | |
| 12 | + private location: Location, | |
| 13 | + ) { } | |
| 11 | 14 | |
| 12 | 15 | ngOnInit() { | 
| 13 | 16 | } | 
| 14 | 17 | |
| 18 | + goBack() { | |
| 19 | + this.location.back(); | |
| 20 | + } | |
| 21 | + | |
| 15 | 22 | } | 
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
| ... | ... | @@ -133,7 +133,7 @@ | 
| 133 | 133 | <div class="col-auto p-0 mt-2 ml-auto h-20"> | 
| 134 | 134 | <div | 
| 135 | 135 | class="btn-effect col-auto align-self-center px-0 bg-white" | 
| 136 | - [routerLink]="['/carrito']" skipLocationChange> | |
| 136 | + [routerLink]="['/carrito']"> | |
| 137 | 137 | <div class="row mx-0 bg-light"> | 
| 138 | 138 | <div class="col-auto align-self-center text-primary">VER CARRITO</div> | 
| 139 | 139 | <div class="col-auto p-0 bg-primary d-none d-sm-block"> | 
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
| ... | ... | @@ -10,7 +10,10 @@ export class SeleccionArticulosComponent implements OnInit { | 
| 10 | 10 | categorias = [ | 
| 11 | 11 | { id: 1, selected: false }, | 
| 12 | 12 | { id: 2, selected: false }, | 
| 13 | - { id: 3, selected: false } | |
| 13 | + { id: 3, selected: false }, | |
| 14 | + { id: 4, selected: false }, | |
| 15 | + { id: 5, selected: false }, | |
| 16 | + { id: 6, selected: false } | |
| 14 | 17 | ]; | 
| 15 | 18 | |
| 16 | 19 | constructor() {} |