0
关于MongoDB和Meteor模板的QQ。我试图设置一个帮助器来显示给定数据库中的每张照片,并且无法拉取图像。使用流星帮手调用MongoDB
现在从我的DB文件看起来像:
{ "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();
}
});
谢谢!
这是它:)谢谢Akshat! – Seano314 2014-08-28 15:42:34