Skip to main content

Modal Service

The Modal Service provides custom modal related capabilities.

Methods

createModal(modalClass, modalKey)

Description

  • Registers a custom modal.

Return Value: null

Options:

  • modalClass: Modal this argument is a class which subclasses the Modal class.
  • modalKey: String used to reference the created Modal instance.

Code Example

digideckCore.modalService.createModal(modalClass, modalKey);

openModal(modalKey, options, onModalCloseCallback)

Description

Return Value: null

Options:

  • modalKey: String reference string for the created Modal instance.

  • options: Object attributes for the modal instance. key value pairs used for the attributes on the Web Component modal.

    • appendToFixedAspectElement: Boolean: If enabled, will open the modal in the fixed-aspect-ratio containing div (will fallback to body if it cannot find fixed-aspect-ratio containing div).
  • onModalCloseCallback: Function Saved as an instance variable on the Modal class instance, and invoked when modal.closeModal(data) is invoked, passing the data variable to the callback.

Code Example

digideckCore.modalService.openModal(modalKey, modalKey);