如何使用 Meteor Spacebars {{#each}} 块迭代字符串数组?

How do I iterate over an array of Strings with the Meteor Spacebars {{#each}} block?

我有一个 Mongo.Collection 可以容纳 'Question' 个对象。每个 'Question' 都有一个 属性 叫做 choices

Questions.insert({
    text: 'What is the capitol of the US?',
    choices: [
    "Washington D.C.",
    "Houston",
    "New York City",
    "Los Angeles"
    ],
    correctChoice: 0,
    date: new Date().toDateString()
});

在我的模板中有这个:

<div class="question">
    <div class="question-content">
        <p>{{text}}</p>
        <ul>
            {{#each choices}}
            //?????????
            {{/each}}
        </ul>
    </div>
</div>

What should I put instead of the question marks in order for popular the unordered list with list items that contain the appropriate choices?

感谢您的阅读。对不起,如果这很容易。我对 Meteor 还是有点菜鸟。 =)

看起来这个问题已经在评论中解决了,但是这个问题有了答案:你应该在当前上下文是原始上下文的情况下使用this

<div class="question">
  <div class="question-content">
    <p>{{text}}</p>
    <ul>
      {{#each choices}}
        <li>{{this}}</li>
      {{/each}}
    </ul>
  </div>
</div>