DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • hook
  • / On this page
    • hook

      function

      Create a hookup to insert into templates.

      • source

      can.view.hook(callback)

      Parameters

      1. callback {function}:

        A callback function to be called with the element.

      Registers a hookup function that can be called back after the html is put on the page. Typically this is handled by the template engine. Currently only EJS supports this functionality.

      var id = can.view.hook(function(el){
             //do something with el
          }),
          html = "<div data-view-id='"+id+"'>"
      $('.foo').html(html);
      

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