我在mongo集合中有一个整数来定义一个计数,称为“tweet\u count”。我需要基于此值重复一个图标,如下所示:
帮手:
Template.companyList.helpers({
companies: function () {
return Tweets.find();
}
});
火焰:
{{#each companies}}
{{ LOOP BASED ON tweet_count}}
<i class="fa fa-circle"></i>
{{ /LOOP }}
{{/each}}
{
"_id" : "xxx",
"name" : "xxx",
"handle" : "xxx",
"tweet_count" : 2,
"tweets" : [
{
"tweet_id" : "x",
"text" : "x",
"created_at" : "Tue Jul 04 15:56:33 +0000 2017",
"retweet_count" : 0,
"from" : "x",
"from_full_name" : "x",
"from_profile_image" : "x"
},
{
"tweet_id" : "x",
"text" : "x9",
"created_at" : "Tue Jul 04 15:56:47 +0000 2017",
"retweet_count" : 0,
"from" : "x",
"from_full_name" : "x",
"from_profile_image" : "x"
}
]
}
each
但它只接受一个数组,我没有这个值,因为它只是一个数字。