import { Injectable } from '@angular/core' ; import { EditDialogComponent , EditDialogOptions } from '../components/edit-dialog/edit-dialog.component' ; import { MatDialog } from '@angular/material' ; import { DeleteDialogComponent } from '../components/delete-dialog/delete-dialog.component' ; import { CreateDialogOptions , CreateDialogComponent } from '../components/create-dialog/create-dialog.component' ; @ Injectable ( ) export class DialogService { constructor ( private dialog ) { } edit ( options ) { return this . dialog . open ( EditDialogComponent , { data : options } ) . afterClosed ( ) ; } delete ( options = { } ) { return this . dialog . open ( DeleteDialogComponent , { data : options } ) . afterClosed ( ) ; } create ( options ) { return this . dialog . open ( CreateDialogComponent , { data : options } ) . afterClosed ( ) ; } }