blockly > inject
inject() function
Inject a Blockly editor into the specified container element (usually a div).
Signature:
export declare function inject(container: Element | string, opt_options?: BlocklyOptions): WorkspaceSvg;
Parameters
Parameter |
Type |
Description |
container |
Element | string |
Containing element, or its ID, or a CSS selector. |
opt_options |
BlocklyOptions |
(Optional) Optional dictionary of options. |
Returns:
WorkspaceSvg
Newly created main workspace.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `inject()` function embeds a Blockly editor into a designated HTML element, like a `\u003cdiv\u003e`, identified by its ID or a CSS selector."],["It accepts an optional `BlocklyOptions` object for customizing the editor's appearance and behavior."],["Upon successful injection, the function returns a `WorkspaceSvg` object, representing the main workspace of the newly created Blockly editor."]]],[]]