2020-06-16 18:40:48 +02:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
providedIn: 'root',
|
|
|
|
})
|
|
|
|
export class ToastService {
|
|
|
|
constructor(private _snackBar: MatSnackBar) {}
|
|
|
|
|
|
|
|
public display(message: string, action?: string): void {
|
2021-06-10 14:12:57 +02:00
|
|
|
const config: MatSnackBarConfig = { duration: 4000, verticalPosition: 'top' };
|
2020-06-16 18:40:48 +02:00
|
|
|
this._snackBar.open(message, action, config);
|
|
|
|
}
|
|
|
|
}
|