0

我有这个流星收藏。我能够让问题显示在页面上,但我不知道如何分别显示数组“ansChoices”,以便可以为数组中的每个项目添加一个单选按钮。

//我在mongodb中的表

pollQuestion {“问题”:“有趣吗?”,“ansChoices”:[“是”,“否”],“_id”:“4rfqgkbZWPRjqkgAR”}

//poll.js

  Template.pollQn.view = function(){
    return pollQuestion.find({});
  };

//poll.html

<template name="pollQn">
    {{#each view}}
        <div class="text-inverse"><b>{{question}}</b></div>
        {{#each ansChoices}}
        <div class="text-inverse">//what should i put here to display 
        individual item in the ansChoices array</div>
        {{/each}}
    {{/each}} </template>

提前致谢!

4

1 回答 1

1

由于您的上下文是一个字符串,您应该使用上下文本身:{{this}}

于 2013-06-09T05:32:28.947 回答