DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
    • can-construct
    • can-control
    • can-event
      • static
        • addEventListener
        • bind
        • delegate
        • dispatch
        • listenTo
        • off
        • on
        • one
        • removeEventListener
        • stopListening
        • trigger
        • unbind
        • undelegate
    • can-event/async/async
    • can-event/batch/batch
    • can-observation
    • can-simple-map
    • can-util
    • can-view-callbacks
    • can-view-live
    • can-view-model
    • can-view-nodelist
    • can-view-parser
    • can-view-scope
    • can-view-target
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Infrastructure
  • /
  • can-event
  • /
  • listenTo
  • / On this page
    • listenTo

      function
      • source

      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

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

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

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.