New to Kendo UI for AngularStart a free 30-day trial

DialogService

A service for opening Dialog windows dynamically (see example).

Constructors

DialogService

(containerService: DialogContainerService)

Parameters

containerService

DialogContainerService

Methods

open

Opens a Dialog window. Requires an element in the application that uses the kendoDialogContainer directive. Created Dialogs will be mounted in the DOM directly after that element.

ts
@Component({
  selector: 'my-app',
  template: `
    <button kendoButton (click)="open()">Harmless button</button>
    <div kendoDialogContainer></div>
  `
})
export class AppComponent {
    constructor( private dialogService: DialogService ) {}

    public open() {
        var dialog = this.dialogService.open({
          title: "Please confirm",
          content: "Are you sure?",
          actions: [
            { text: "No" },
            { text: "Yes", themeColor: 'primary' }
          ]
        });

        dialog.result.subscribe((result) => {
          if (result instanceof DialogCloseResult) {
            console.log("close");
          } else {
            console.log("action", result);
          }
        });
    }
}
Parameters

options

DialogSettings

The options that define the Dialog.

Returns

DialogRef

  • A reference to the Dialog object and the convenience properties.
In this article
ConstructorsDialogServiceMethods
Not finding the help you need?
Contact Support