on
Add event handlers to a list.
list.on(eventType, handler)
Listens to eventType
on list
and calls handler
when the event is dispatched. This is simply
a reference to can-event.on as all of can-event methods are available on DefineMap
.
var list = new DefineList(["CanJS","StealJS"])
list.on("add", function(ev, added, index){ ... });
list.push("DoneJS");
Parameters
- eventType
{String}
:The type of event to bind this handler to.
- handler
{function(event, args...)}
:The handler to be called when this type of event fires The signature of the handler depends on the type of event being bound.