@function can.stache.helpers.data {{data name}}
@parent can.stache.htags 7
@signature {{data name[ key]}}
Adds the current [can.stache.context context] to the element's [can.data].
@param {String} name The name of the data attribute to use for the context.
@body
It is common to want some data in the template to be available
on an element. {{data name}}
allows you to save the
context so it can later be retrieved by [can.data] or
$.fn.data
.
JS Bin<script src="http://static.jsbin.com/js/embed.js"></script>
By passing a key name as the second argument to the data helper, you can specify which data is used: {{data name key}}
.
JS Bin<script src="http://static.jsbin.com/js/embed.js"></script>