DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
    • can-construct-super
    • can-define-stream
    • can-fixture
    • can-fixture-socket
    • can-jquery
      • Modules
        • ./legacy
      • Methods
        • viewModel
    • can-stache-converters
    • can-stream
    • can-vdom
    • can-view-import
    • can-zone
    • steal-stache
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Ecosystem
  • /
  • can-jquery
  • /
  • viewModel
  • / On this page
    • viewModel

      function

      Gets an element's View Model.

      • source

      .viewModel()

      Calls can-view-model with the unwrapped HTMLElement.

      var vm = $("my-component").viewModel();
      

      Returns

      {can-define/map/map|can-map|Object}:

      Returns the View Model set for this element.

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