【发布时间】:2015-08-10 05:26:49
【问题描述】:
我有两个收藏,一个收藏有汽车图片(上传),另一个收藏有汽车信息(汽车),colleciton car 的 id 与carid 相同(上传收藏)。我需要这样做以显示带有图片的桌面车。
这是我的代码:
Template.Araclar.helpers({
manset: function() {
getData = Cars.find({});
return Cars.find({});
Uploads.find({
"carid": getData._id
});
}
});
<div class="row">
{{#each manset}}
<div>{{aracmarka}}</div>
<div style="width:400px; height:200px;" class="col-lg-3 col-md-4 col-xs-6 thumb m-t-30">
<a>
<img class="img-responsive" style="height:200px;" src="{{url}}" alt="">
</a>
</div>
{{/each}}
</div>
注意:{{aracmarka}} 来自 Cars 集合 {{url}} 来自 Uploads 集合。
【问题讨论】:
标签: javascript meteor meteor-helper