我有一个在 Node、Express 和 express-handlebars 上运行的应用程序。该变量是分配给res.locals
条件助手“ifCond”的查询的结果,例如这个。需要渲染的代码是部分的。问题是助手在使用变量时不起作用:
//getting the variable works
{{groups}} // Group2
//works with standart block helper
{{#if groups}}1{{else}}2{{/if}} // 1
//helper is working
{{#ifCond 5 "==" 5}}equal{{else}}not equal{{/ifCond}} //equal
//not working when using variable with helper
{{#ifCond groups "==" Group2}}equal{{else}}not equal{{/ifCond}} //not equal
什么会导致它不能与助手一起工作?谢谢你。