【发布时间】:2016-08-01 20:31:14
【问题描述】:
我是 Meteor/Handlebars 的新手,使用包含这两个助手的流星包 https://atmospherejs.com/aldeed/plans-stripe。
AppPlans.listDefined() - to get the list of all our plans
- ["free", "monthly", "yearly"]
AppPlans.get() - to see which plan the user currently has.
- ["free"]
还有https://github.com/raix/Meteor-handlebar-helpers 有这个有用的助手:
{{$eq a b}} if a equals b then return true
我在我的 HTML 中显示计划,如下所示:
{{#each AppPlans.listDefined}}
<strong>{{this}}</strong>
{{/each}}
但我想做的是这样的;这不起作用
{{#each AppPlans.listDefined}}
{{#if $eq AppPlans.listDefined AppPlans.get}}
<strong>{{this}}</strong>
{{else}}
<span>{{this}}</span>
{{/if}}
{{/each}}
解决此问题的最佳方法是什么?
【问题讨论】:
标签: javascript meteor handlebars.js