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.
Copy Code @ 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) ;
}
} ) ;
}
}
DialogRef
A reference to the Dialog object and the convenience properties.