Commit b363e367e7b5e85f88e443f7fa0880c47d85dfe1
1 parent
089381c5a5
Exists in
master
Bandera para desactivar paginador mientras carga.
Showing
2 changed files
with
9 additions
and
6 deletions
Show diff stats
src/app/components/amb-imagenes/amb-imagenes.component.html
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 | } |