import {Injectable, TemplateRef} from '@angular/core'; import {NbDialogConfig, NbDialogRef, NbDialogService} from '@nebular/theme'; import {ComponentType} from '@angular/cdk/overlay'; @Injectable({ providedIn: 'root' }) export class DialogService { constructor(private dialog: NbDialogService) { } /** * Opens a custom MatDialog */ openCustomDialog( componentOrTemplateRef: ComponentType | TemplateRef, config?: Partial | string>> ): NbDialogRef { return this.dialog.open(componentOrTemplateRef, { context: config?.context || undefined, closeOnEsc: config?.closeOnEsc || false, hasScroll: config?.hasScroll || false, autoFocus: config?.autoFocus || false, closeOnBackdropClick: config?.closeOnBackdropClick || false, }); } }