import { Injectable } from '@angular/core' ; import { MatSnackBar , MatSnackBarRef , SimpleSnackBar } from '@angular/material/snack-bar' ; @ Injectable ( ) export class SnackbarService { constructor ( private snackBar ) { } open ( message , action ? ) { return this . snackBar . open ( message , action || 'Ok' , { duration : 2000 } ) ; } }