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
    • can-simple-map
    • can-util
    • can-view-callbacks
    • can-view-live
    • can-view-model
    • can-view-nodelist
    • can-view-parser
    • can-view-scope
      • types
        • Meta
      • static
        • Options
      • prototype
        • add
        • compute
        • get
        • peek
        • set
    • can-view-target
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Infrastructure
  • /
  • can-view-scope
  • /
  • set
  • / On this page
    • set

      function
      • source

      scope.set(key, value [, options])

      Tries to set key in the scope to value. This looks for the first context in the value where key can be set. For example, if key is "person.first.name", it will find the first context where person.first is some type of Object whose name property can be set.

      scope.set("person.first.name", "Justin");
      

      Parameters

      1. key {key}:

        A dot seperated path. Use "." if you have a property name that includes a dot.

      2. value {*}:

        The value to be set.

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