【发布时间】:2014-09-05 05:10:40
【问题描述】:
我用 UI.registerHelper 添加了一个全局帮助函数,它返回一个字符串。如果我访问特定站点,我可以看到正确的输出,但我得到以下异常:
Exception in template helper: http://localhost:3000/client/helpers/global_helpers.js?c1af37eca945292843a79e68a3037c17a0cfc841:18:45
http://localhost:3000/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:2458:21
这是我的代码:
UI.registerHelper('levelMode', function() {
return Games.findOne({_id: this._id}).mode ? 'Difficult' : 'Easy';
});
任何想法如何解决这个问题?
【问题讨论】:
标签: javascript meteor