Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Custom ViewModel event bindings">
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  
<div id='out'></div>
  
  
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.js"></script>
<script src="//canjs.com/release/2.3.7/can.jquery.js"></script>
<script src="//canjs.com/release/2.3.7/can.stache.js"></script>
</body>
</html>
 
can.stache.registerHelper("helper", 
                          function(method){
  return method()();
});
var map = new can.Map({
  func: function(){
    return "attribute";
  }
});
var template = can.stache("{{helper @func}}");
$("#out").html( template(map) );
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x