Class: Component

jBlocks. Component


new Component(node, name, props)

Parameters:
Name Type Description
node HTMLElement
name String
props Object

Members


name :String

Name of the components used in decl
Type:
  • String

node :HTMLElement

Node which component is binded with
Type:
  • HTMLElement

props :Object

Props of the component gained from data-props
Type:
  • Object

Methods


destroy()

Destroy the instance
Returns:
Type
jBlocks.Component

emit(event, data)

Execute all handlers attached for the given event
Parameters:
Name Type Description
event String
data *
Returns:
Type
jBlocks.Component

off(event, callback)

Remove an event handler function for the given event
Parameters:
Name Type Description
event String
callback function
Returns:
Type
jBlocks.Component

on(event, callback)

Attach an event handler function for the given event
Parameters:
Name Type Description
event String
callback function
Returns:
Type
jBlocks.Component

once(event, callback)

Attach an event handler function for the given event which will be called only once
Parameters:
Name Type Description
event String
callback function
Returns:
Type
jBlocks.Component