Add error handling and snackbar notifications

Introduces error state management in LoadingService, displays error bar and snackbar notifications in the UI, and updates ScheduleComponent to use the new error handling. Also adds custom theming for error snackbar and progress bar.
This commit is contained in:
2025-10-31 16:19:02 +01:00
parent 0828493be5
commit 5addba879a
6 changed files with 113 additions and 29 deletions

View File

@@ -24,7 +24,9 @@
</div>
</div>
@if (loading$ | async) {
@if (loadingService.error$ | async) {
<div class="h-1 w-full" style="background-color: red;"></div>
} @else if (loadingService.loading$ | async){
<mat-progress-bar
mode="indeterminate"
class="h-1 w-full"

View File

@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import { LoadingService } from '../loading.service';
@Component({
@@ -8,8 +8,5 @@ import { LoadingService } from '../loading.service';
styleUrl: './header-2.component.css'
})
export class Header2Component {
loading$;
constructor(private loadingService: LoadingService) {
this.loading$ = this.loadingService.loading$;
}
protected loadingService = inject(LoadingService)
}