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.root

Type
NodeApi

Root node object of this module.

js.module.title

Type
string

The title of this module.

js.module.bind_method(method_name, callback)

ParamTypeDescription
method_namestring

name to pass to NodeApi.call

callbackfunction

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)

ParamType
callbackfunction

Bind a function to be executed when the module finishes rendering

js.module.findNode(pattern) ⇒ NodeApi | null

ParamTypeDescription
patternobject

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.