can.off
Stop listening for events on an object.
can.off.call(target, eventName, handler)
Parameters
-
target
{Object}
The object that emits events.
-
eventName
{String}
The name of the event to listen for.
-
handler
{function()}
The function to unbind.
Returns
{Object}
The target.
can.off(eventName, handler)
is an alias forcan.unbind(eventName, handler)
and unbinds a callback handler from an object for a given event. It works on:The idea is that
can.unbind
can be used on anything that produces events and it will figure out the appropriate way to unbind to it. Typically,can.off
is only used internally to CanJS; however, if you are making libraries or extensions, usecan.on
to listen to events independent of the underlying library.Binding/unbinding to an object
Binding/unbinding to an HTMLElement