尝试制作一些简单的把手助手
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
这样做的正确方法是什么。
答案 0 :(得分:5)
Handlebars对象仅在客户端上可用。因此,请确保将if (Meteor.isClient) { }
包裹在帮助程序注册码