Events
You can emit events from your cbwire components, views, and also direct from JavaScript. Listeners can be defined to execute specific actions.
From View
<button wire:click="$emit( 'counterIncremented' )">From Component
this.emit( "counterIncremented" );From Javascript Global
<script>
cbwire.emit( 'counterIncremented' );
</script>Event Listeners
component extends="cbwire.models.Component"{
variables.listeners = {
"counterIncremented": "tweetAboutIt"
};
function tweetAboutIt(){
// Blow up Twitter
}
...
}Event Listeners In JavaScript
Last updated
Was this helpful?