snackbar.service.ts 384 Bytes
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import { Injectable } from '@angular/core';

import { MatSnackBar, MatSnackBarConfig } from '@angular/material';

@Injectable()
export class SnackBarService {
  config = new MatSnackBarConfig()

  constructor(
    public snackBar: MatSnackBar,
  ) {
    this.config.duration = 3000;
  }

  public open(message: string) {
    return this.snackBar.open(message, '', this.config);
  }
}