import { Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ErrorDialogComponent } from './error-dialog/error-dialog.component'; @Injectable({ providedIn: 'root' }) export class ErrorDialogService { constructor(public dialog: MatDialog) { } openDialog(module: string, func: string, msg: string): void { const dialogRef = this.dialog.open(ErrorDialogComponent, { width: '450px', data: { module: module, func: func, msg: msg } }) } }