Home > @jsplumbtoolkit/dialogs-core > extract
extract() function
Extracts a dataset from the given element by finding child elements that have a jtk-att attribute set, and extracting from those elements their value. When the same jtk-att value appears more than once as a child of el, the values are stored in an array for that field.
Signature:
export declare function extract(el: HTMLElement, unresolvedElementGetter?: (el: Element) => any): Record<string, any>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| el | HTMLElement | Element to extract values from. |
| unresolvedElementGetter | (el: Element) => any | Optional function to use when an element with an unknown tag has a jtk-att declared on it. This function is given the element and whatever it returns - even null - will be set on the outgoing data. |
Returns:
Record<string, any>