Import
Usage
Methods
createModal(template, styleSheet, callbacks) : Modal
Name | Type | Description |
---|
template | Function | Imported HTML template |
stylesheet | Function | Imported CSS stylesheet |
callbacks | ModalCallbacks | To define initialRenderCallback , disconnectedCallback and eventHandlerCallbacks |
open(params) : Promise<boolean>
Name | Type | Description |
---|
$ | Object | Super object to pass any data you want to use inside the modal context |
Example
Passing data
Yes / No choice modal
The promise resolved value will be determined by which button was pushed to exit the modal.
[data-yes]
resolves to true
[data-no]
resolves to false
The promise resolved value will be determined by which button was pushed to exit the modal.
[data-yes]
resolves to an object whose keys are the [data-yield]
attributes chosen value and their values are the inputs value
[data-no]
resolves to false
Passing initial rendered callback
This callback is executed once. You have access to an argument whose type is this
in the modal context.
Passing event handler callbacks
You have access to those callbacks in the template of your modal