can.trigger
Trigger an event on an object.
can.trigger(target, eventName[, args])
Parameters
-
target
{Object}
The object to trigger the event on.
-
eventName
{String}
The event to trigger.
-
args
{Array<*>}
OptionalThe event data.
can.trigger(target, eventName)
triggers an artificial event on an object and fires all associated callback handlers that were bound to it. This is exceptionally handly for simulating events. Such as the following: