Meteor Display Array Inside A Collection
I want create a posts model, with tags, and be able to display all tags for each post. You know a best way to do it ?? I tried this {{#each pos
Solution 1:
You need to use this
keyword to get value from an array:
<template name='postDetails'>
title: {{title}}
{{#each tag}}
{{this}}
{{/each}}
</template>
Solution 2:
This code won't work:
{{#each tag}}
{{tag}}
{{/each}}
because "tag" here refers to both the list and an element in that list. Try:
{{#each tags}}
{{tag}}
{{/each}}
Post a Comment for "Meteor Display Array Inside A Collection"