We are implementing the Kendo dialog box using angular, and we want to access the dialog box component from a service. Currently this is achieved through material dialog box.
Below code for reference using material dialog
MyService.ts
import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { WarningBoxComponent } from './warning-box/warning-box.component';
@Injectable({
providedIn: 'root'
})
export class MessageBoxService {
constructor(public dialog: MatDialog) { }
public OpertaionNotAllowed(fieldName: string): void {
this.dialog.open(WarningBoxComponent, {
data: {
boxTitle: 'Not Allowed!',
errorMessage: fieldName + ' operation is not allowed..!'
}
});
}