From 4a3ffc23bd30647667b1d701a013ea74942baaf8 Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Wed, 25 Nov 2020 22:10:18 +0100 Subject: [PATCH] added basic snackbar --- src/app/services/snackbar.service.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/app/services/snackbar.service.ts diff --git a/src/app/services/snackbar.service.ts b/src/app/services/snackbar.service.ts new file mode 100644 index 0000000..7df0077 --- /dev/null +++ b/src/app/services/snackbar.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import {MatSnackBar} from '@angular/material/snack-bar'; + +@Injectable({ + providedIn: 'root', +}) +export class SnackBarService { + + constructor(private snackBar : MatSnackBar) { } + + + openSnackBar(message: string, action: string) { + this.snackBar.open(message, action, { + duration: 5000, + panelClass: ['mat-toolbar', 'mat-primary'] + }); + } +}