• Getting Started
  • Components
    • Barcodes
    • Buttons
    • Chartsupdated
    • Conversational UIupdated
    • Data Query
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filter
    • Gantt
    • Gauges
    • Gridupdated
    • Icons
    • Indicators
    • Inputsupdated
    • Labels
    • Layout
    • ListBox
    • ListView
    • Map
    • Menus
    • Navigation
    • Notification
    • Pager
    • PDF Export
    • PDFViewer
    • PivotGrid
    • Popup
    • ProgressBars
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • ToolBar
    • Tooltips
    • TreeList
    • TreeView
    • Typography
    • Uploads
    • Utilities
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Sample Applications
  • FAQ
  • Troubleshooting
  • Updates
  • Changelogs
New to Kendo UI for Angular? Start 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.

@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.