UNPKG

@progress/kendo-angular-dialog

Version:
75 lines (74 loc) 2.68 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { ComponentFactoryResolver } from '@angular/core'; import { DialogContainerService } from './dialog-container.service'; import { DialogRef } from './models/dialog-ref'; import { DialogSettings } from './models'; import * as i0 from "@angular/core"; /** * A service for opening Dialog windows dynamically * ([see example]({% slug service_dialog %})). */ export declare class DialogService { /** * @hidden */ private resolver; private containerService; constructor( /** * @hidden */ resolver: ComponentFactoryResolver, containerService: DialogContainerService); /** * Opens a Dialog window. Requires an element in the application that uses the * [`kendoDialogContainer`]({% slug api_dialog_dialogcontainerdirective %}) directive. * Created Dialogs will be mounted in the DOM directly after that element. * * @param {DialogAction} options - The options that define the Dialog. * @returns {DialogRef} - A reference to the Dialog object and the convenience properties. * * @example * * ```ts-no-run * _@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); * } * }); * } * } * ``` * */ open(options: DialogSettings): DialogRef; private initializeDialog; private applyOptions; private contentFrom; static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>; }