bind
can.Model.bind
Listen for events on a Model class.
can.Model.bind(eventType, handler)
Parameters
-
eventType
{String}
The type of event. It must be
"created"
,"updated"
,"destroyed"
. -
handler
{function()}
A callback function that gets called with the event and instance that was created, destroyed, or updated.
Returns
{can.Model}
The model constructor function.
bind(eventType, handler(event, instance))
listens to created, updated, destroyed events on all instances of the model.