我想创建一个带有标签的帖子模型,并能够显示每个帖子的所有标签。你知道最好的方法吗??
我试过了
<template name='postsLists'>
{{#each post}}
{{> postDetails }}
{{/each}}
</template>
<template name='postDetails'>
title: {{title}}
{{#each tag}}
{{tag}}
{{/each}}
</template>
最佳答案
您需要使用this
关键字从数组中获取值:
<template name='postDetails'>
title: {{title}}
{{#each tag}}
{{this}}
{{/each}}
</template>
关于javascript - 集合内的 meteor 显示数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14219222/