Modal Service
The Modal Service provides custom modal related capabilities.
Methods
createModal(modalClass, modalKey)
Description
- Registers a custom modal.
Return Value: null
Options:
modalClass: Modalthis argument is a class which subclasses the Modal class.modalKey: Stringused to reference the created Modal instance.
Code Example
digideckCore.modalService.createModal(modalClass, modalKey);
openModal(modalKey, options, onModalCloseCallback)
Description
- opens the custom modal which was created by
modalService.createModal.
Return Value: null
Options:
-
modalKey: Stringreference string for the created Modal instance. -
options: Objectattributes 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: FunctionSaved as an instance variable on the Modal class instance, and invoked whenmodal.closeModal(data)is invoked, passing thedatavariable to the callback.
Code Example
digideckCore.modalService.openModal(modalKey, modalKey);