如何WinJS.Binding.Template
在我的WinJS.UI.ListView
控制范围内循环遍历项目?
我的数据:
{ category: 'Sports',
items: [
{ title: 'soccer'}, { title: 'tennis'}
]
}
我想在我的模板中做什么:
<div id="myTmpl" data-win-control="WinJS.Binding.Template" style="display:none">
<h1 data-win-bind="innerText: category"></h1>
<div data-win-REPEATER="each: items">
<span data-win-bind="innerText: title"></span>
</div>
</div>