fix: show spinner after click on retry

This commit is contained in:
Polianin Nikita 2024-09-30 01:30:23 +03:00
parent a86e88e087
commit 6211dd8889
2 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,7 @@
@if (loading) {
<app-data-spinner/>
} @else {
<button mat-fab color="primary" (click)="retryFunction.emit()">
<button mat-fab color="primary" (click)="retryLoad()">
<mat-icon>refresh</mat-icon>
</button>
}

View File

@ -18,4 +18,9 @@ import {MatButton, MatFabButton} from "@angular/material/button";
export class LoadingIndicatorComponent {
@Input() loading: boolean = true;
@Output() retryFunction: EventEmitter<void> = new EventEmitter<void>();
protected retryLoad() {
this.loading = true;
this.retryFunction.emit();
}
}