16 lines
330 B
TypeScript
16 lines
330 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class ToasterService {
|
|
constructor(private snackBar: MatSnackBar) {}
|
|
|
|
show(type: string, msg: string) {
|
|
this.snackBar.open(msg, type, {
|
|
duration: 3000,
|
|
});
|
|
}
|
|
}
|