ModuleApi¶
Interface to module object. The current module object is accessed from
js.module.
js.module.children¶
| Type |
|---|
array.<NodeApi> |
External child nodes which have been attached to the reference node which is representing this module. These may be rendered and attached anywhere in the module.
js.module.bind_method(method_name, callback)¶
| Param | Type | Description |
|---|---|---|
| method_name | string | name to pass to NodeApi.call |
| callback | function | take parameters and return value or Promise. |
Bind a function as a method with the given name on reference nodes which represent this module. The provided callback function may return a value, or a Promise.
js.module.ready(callback)¶
| Param | Type |
|---|---|
| callback | function |
Bind a function to be executed when the module finishes rendering
js.module.findNode(pattern) ⇒ NodeApi | null¶
| Param | Type | Description |
|---|---|---|
| pattern | object | object to match with a node, using _.isMatch() |
Find the first node in the module which matches the pattern.
Returns: NodeApi | null - the matching NodeApi object, or null if not found.