MongoDB和Meteor模板上的QQ。我正在尝试设置一个助手来显示给定数据库中的每张照片,但我在提取图像时遇到了问题。
现在,我的数据库中的文档如下:
{ "order" : 19,
"img" : "http://foo.cdninstagram.com/photo.jpg",
"time" : "99999999999",
"user" : { "username" : "ME!",
"website" : "",
"profile_picture" : "http://foo.instagram.com/foophoto.jpg",
"full_name" : "Monique Rana",
"bio" : "",
"id" : "1234567" },
"_id" : "abc123" }
下面是我正在使用的代码。
<template name="currentTag">
<div class="container">
<ul class="grid effect-8" id="grid">
{{#each Tag}}
<li><img src="{{Tags.img}}"></li>
{{/each}}
</ul>
</div>
</template>
以及我正在构建的助手:
Template.currentTag.helpers({
Tag: function () {
return Tags.find().fetch();
}
});
谢谢