Commit b363e367e7b5e85f88e443f7fa0880c47d85dfe1

Authored by Marcelo Puebla
1 parent 089381c5a5
Exists in master and in 1 other branch validar_pve

Bandera para desactivar paginador mientras carga.

src/app/components/amb-imagenes/amb-imagenes.component.html
... ... @@ -92,6 +92,7 @@
92 92 [itemsPerPage]="paginationData.pageSize"
93 93 (pageChanged)="pageChanged($event)"
94 94 [boundaryLinks]="true"
  95 + [disabled]="disabledPaginador"
95 96 previousText="‹"
96 97 nextText="›"
97 98 firstText="«"
src/app/components/amb-imagenes/amb-imagenes.component.ts
... ... @@ -17,6 +17,7 @@ export class AmbImagenesComponent implements OnInit {
17 17 private auxProductos: Producto[] = [];
18 18 private searchTerm: string = '';
19 19 private paginationData: any;
  20 + private disabledPaginador: boolean = false;
20 21  
21 22 constructor(private productoService: ProductoService, private http: HttpClient) { }
22 23  
... ... @@ -110,13 +111,14 @@ export class AmbImagenesComponent implements OnInit {
110 111 }
111 112  
112 113 pageChanged(event: any): void {
  114 + this.disabledPaginador = true;
113 115 this.productoService.getAllWithPaginator(event.page)
114   - .subscribe((res) => {
115   -
116   - this.articulos = res.data;
117   - this.paginationData = res.pagination;
118   - this.filterItems();
119   - }, error => console.error(error));
  116 + .subscribe((res) => {
  117 + this.disabledPaginador = false;
  118 + this.articulos = res.data;
  119 + this.paginationData = res.pagination;
  120 + this.filterItems();
  121 + }, error => console.error(error));
120 122 }
121 123  
122 124 }