Developer / Reference / TypeScript APIs

ScifeonDialog

Last updated on 13-May-2020 by Jakob Jakobsen Boysen
Jakob Jakobsen Boysen

Platform Lead
boysen@scifeon.com

This class is used for showing dialogs (or popups). The class is wrapping the Aurelia Dialog-plugin, which is why there are some references to the documentation of this.

Example

API

Methods

open(options: any): DialogOpenPromise<DialogOpenResult | DialogCancelResult>

Parameters

  • options An object with the following possible values:

Returns

A DialogClosePromise, with the method .whenClosed(result => ...).

Example

confirm(question: string): Promise<boolean>

Show a simple popup with the question and 'Yes' and 'No' buttons.

Parameters

  • question The question to show.

Returns

Returns true or false through a promise.

Example

message(message: string): DialogOpenPromise<DialogOpenResult | DialogCancelResult>

Show a simple popup with the message and an 'OK' button.

Parameters

  • message The message to show.

Returns

Returns a promise with a true value.

Example

close(ok: boolean = true, object: any = null): void

Closes the current dialog.

Parameters

  • ok Whether the result should be ok or not.
  • object The object to return to the callee of the current dialog.

cancel(output: any = null): void

Cancels (and closes) the current dialog.

Parameters

  • object The object to return to the callee of the current dialog.

ok(output: any = null): void

Closes the current dialog with an OK value.

Parameters

  • object The object to return to the callee of the current dialog.