new Events()
- Source
Methods
off(eventName)
Removes the subscriptions with a given event name.
Parameters:
| Name | Type | Description |
|---|---|---|
eventName | string | Name of the event. |
- Source
on(eventName, callback)
Subscribes to controller resource with a given event name
Parameters:
| Name | Type | Description |
|---|---|---|
eventName | string | Name of the event |
callback | function | Function to be called when event is triggered |
- Source
trigger(eventName, data)
Triggers all the callback functions that have subscribed to an event.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
eventName | string | Name of the event to be triggered | |
data | any | null | Data passed to the callback as input parameter |
- Source