Commit bc753a27efb30d2250f653c8fbec7baa3c85b2ef
1 parent
540f91d409
Exists in
develop
agrego spinner en seleccion-articulos
Showing
3 changed files
with
15 additions
and
2 deletions
 
Show diff stats
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
| ... | ... | @@ -28,6 +28,14 @@ | 
| 28 | 28 | <div | 
| 29 | 29 | class="col-7 col-sm-9 col-xl-10 pb-3 h-100 align-self-center scroll-y-visible" | 
| 30 | 30 | (scroll)="scrollEvent($event)"> | 
| 31 | + <!-- SPINNER --> | |
| 32 | + <div | |
| 33 | + class="d-flex justify-content-center" | |
| 34 | + *ngIf="loading"> | |
| 35 | + <div class="spinner-border text-primary mt-5" role="status"> | |
| 36 | + <span class="sr-only">Loading...</span> | |
| 37 | + </div> | |
| 38 | + </div> | |
| 31 | 39 | <div class="row row-cols-1 row-cols-sm-3 row-cols-xl-6"> | 
| 32 | 40 | <!-- ARTICULO --> | 
| 33 | 41 | <div | 
src/app/modules/seleccion-articulos/seleccion-articulos.component.scss
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
| ... | ... | @@ -20,7 +20,7 @@ import { ANIMATIONS } from 'src/app/utils/animations'; | 
| 20 | 20 | animations: [ANIMATIONS.EnterLeaveY] | 
| 21 | 21 | }) | 
| 22 | 22 | export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDestroy { | 
| 23 | - showSpinner = true; | |
| 23 | + loading = true; | |
| 24 | 24 | timeoutHandler: any; | 
| 25 | 25 | urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; | 
| 26 | 26 | articulos: IArticulo[] = []; | 
| ... | ... | @@ -67,7 +67,6 @@ export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDes | 
| 67 | 67 | localStorage.setItem('articulos', JSON.stringify(result)); | 
| 68 | 68 | this.setProductos(); | 
| 69 | 69 | }, (error) => { | 
| 70 | - this.showSpinner = false; | |
| 71 | 70 | console.error(error); | 
| 72 | 71 | }); | 
| 73 | 72 | } | 
| ... | ... | @@ -75,6 +74,7 @@ export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDes | 
| 75 | 74 | setProductos() { | 
| 76 | 75 | this.articulos = JSON.parse(localStorage.getItem('articulos')); | 
| 77 | 76 | this.filterItems(); | 
| 77 | + this.loading = false; | |
| 78 | 78 | } | 
| 79 | 79 | |
| 80 | 80 | filterItems() { |