如果我想将模板绑定到一个普通的旧字符串数组,我将什么放在$ {??}表达式中?
我希望这个片段不会太短,以免混淆:
<ul data-bind="template: { name: 'authorTemplate', foreach: authors }">
</ul>
Run Code Online (Sandbox Code Playgroud)
作者很简单 ["a", "b", "c"]
<script type="text/x-jquery-tmpl" id="authorTemplate">
<li>${what_do_I_put_here???}</li>
</script>
Run Code Online (Sandbox Code Playgroud)
我试过:val value this和this.toString().最后两个显示[object Object],所以我怀疑我离它很近.