本文介绍了如何注册流星空间帮助器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试制作一些简单的把手助手
Trying to make some simple handlebars helpers
Handlebars.registerHelper('if_eq', function(context, options) {
if (context == options.hash.compare)
return options.fn(this);
return options.inverse(this);
});
出现此错误。
ReferenceError: Handlebars is not defined
执行此操作的正确方法是什么。
What's the correct way to do it.
推荐答案
Handlebars对象仅在客户端上可用。所以请确保你有 if(Meteor.isClient){}
包裹助手注册码
the Handlebars object is only available on the client. So make sure you have if (Meteor.isClient) { }
wrapped around the helper registration code
这篇关于如何注册流星空间帮助器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!