I have created a Spine Controller and I want to trigger a custom event ‘Create’ from inside one of it’s methods.
Then I would like another Spine Controller to listen for that event.
How is this possible using Spine.js’s custom event methods?
I have created a Spine Controller and I want to trigger a custom event
Share
Custom events don’t have to be global. You can can trigger/bind events per controller instance, but not per controller class. For instance
But you can’t get something like PresenterController.bind(“speech”)
The reason is that Model uses
@extend Event, which adds methods to the class, but Controller uses@include Event, which adds methods to the instance. Model achieves the appearance of having instance bindings because it defines its own implementations of trigger, bind, and unbind