Component

core/ Component

.new Component(paramsopt, instructionsopt)

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

The parameters object.

instructions Object <optional>

The instructions object.

Extends ModuleSystem

Members

(private) ._wait :Array

Array of promises that should be resolved before Component is ready.

Source:

.children :Array

Collection of child Components.

Source:

.defaults :Object

Default values for parameters

Default Value:
                  {
      modules: [],
      manager: true
    }
                
Source:

.instructions :Object

Static instructions

Default Value:
                  {}
                
Source:

.isDeffered :Boolean

Returns whether the object is async (wait promises are more than 0).

Source:

.manager :ModuleManager

Returns the ModuleManager used for this component.

Source:

.modules :Array

Collection of modules.

Source:

.native :Object

Returns the native object used for this component.

Source:

Methods

.add(object) → {Promise}

Add a child Component.

Source:
Parameters:
Name Type Description
object Component

Component that should be added as a child.

.addTo(object)

Adds this Component to specified App/Component.

Source:
Parameters:
Name Type Description
object Component

Component that will be a parent of this.

.clone() → {object}

Clone this component

Source:

.copy(source, customizeopt) → {this}

Copy source native and integrate modules to it.

Source:
Parameters:
Name Type Attributes Description
source Component

Source component that is used for copy() action.

customize function <optional>

Callback executed before modules integration process.

.defer(func)

Execute func (Callback) when Component is ready.

Source:
Parameters:
Name Type Description
func function

Callback.

.remove(object)

Remove a child Component.

Source:
Parameters:
Name Type Description
object Component

Component that should be a child of this Component.

.updateParams() → {Object}

Updates parameters of the Component.

Source:

.wait(promiseopt) → {Promise}

Wait for a promise.

Source:
Parameters:
Name Type Attributes Description
promise Promise <optional>

The promise that should be added to a queue.