• function

hook can.view.hook

 

Create a hookup to insert into templates.

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);