使用一个数组,评分为3对应着:
html:
{{#each rankicons}}
<span class="glyphicon {{.}} text-danger"></span>
{{/each}}
js:
Template.UserEvaluations.helpers({
rankicons: function() {
return ['glyphicon-star', 'glyphicon-star', 'glyphicon-star', 'glyphicon-star-empty', 'glyphicon-star-empty'];
}
});
Ref:
http://stackoverflow.com/questions/14189672/meteor-iterate-list-in-template