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
    • can-event/async/async
    • can-event/batch/batch
    • can-observation
      • types
        • getTrapped
        • Observed
      • static
        • add
        • addAll
        • ignore
        • isRecording
        • trap
      • prototype
        • start
        • stop
    • 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-observation
  • /
  • add
  • / On this page
    • add

      function

      Signals that an object's property is being observed, so that any functions that are recording observations will see that this object is a dependency.

      • source

      Observation.add(obj, event)

      Signals that an event should be observed. Adds the observable being read to the top of the stack.

      Observation.add(obj, "prop1");
      

      Parameters

      1. obj {Object}:

        An observable object which is being observed.

      2. event {String}:

        The name of the event (or property) that is being observed.

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