listenTo

  • function
 

obj.listenTo( other, event, handler )

Listens for an event on another object. This is similar to concepts like event namespacing, except that the namespace is the scope of the calling object.

Parameters

  1. other {Object}

    The object to listen for events on.

  2. event {String}

    The name of the event to listen for.

  3. handler {function()}

    The handler that will be executed to handle the event.

Returns

{Object}

this

can.event.listenTo.call( obj, other, event, handler )

This syntax can be used for objects that don't include the can.event mixin.