0

I have this meteor collection. I able to get the questions to show on the page but I have no idea how to display the array 'ansChoices' separately so that I could add a radio button to each items in the array.

//my table in mongodb

pollQuestion { "question" : "Is it fun?", "ansChoices" : [ "Yes", "No" ], "_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>

Thanks in advance!

1 Answer 1

1

Since your context is a string you should use the context itself: {{this}}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.