Reviewed-on: http://git.simonis.lol/angular/ems-frontend/pulls/47 Co-authored-by: Jan-Marlon Leibl <jleibl@proton.me> Co-committed-by: Jan-Marlon Leibl <jleibl@proton.me>
19 lines
529 B
TypeScript
19 lines
529 B
TypeScript
import { inject, Injectable } from '@angular/core';
|
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class ErrorHandlerService {
|
|
private readonly snackBar: MatSnackBar = inject(MatSnackBar);
|
|
|
|
public showErrorMessage(message: string): void {
|
|
this.snackBar.open(message, 'Close', {
|
|
duration: 5000,
|
|
horizontalPosition: 'end',
|
|
verticalPosition: 'bottom',
|
|
panelClass: ['!bg-red-50', '!text-red-900', '!border', '!border-red-100'],
|
|
});
|
|
}
|
|
}
|