Events
You can emit events from your cbwire components, views, and also direct from JavaScript. Listeners can be defined to execute specific actions.
You can fire events from within views, components, or by using the global cbwire
JavaScript object.
From View
From Component
From Javascript Global
Event Listeners
You can register event listeners on a component by defining variables.listeners
.
cbwire will invoke the tweetAboutIt
method on the component if any other component on the same page emits a counterIncremented
event.
When defining your listeners, it is good to put your listener's names in quotation marks, as we have in our component above.
"counterIncremented": "tweetAboutIt"
Event Listeners In JavaScript
Last updated