javascript - How to get access to the string when foreach-binding to a list of strings? -
i have template this:
<div data-bind='template: { name: "stringtemplate", foreach: stringcollection() }'> </div> </div> <script id='stringtemplate' type='text/html'> // want display string collection here </script>
how access string object in template?
in jquery template, can use $data
refer overall object being bound.
so, like:
<span data-bind="text: $data"></span>
or
${ $data }
Comments
Post a Comment