如何注册流星空间帮助器?

Har*_*rry 2 javascript meteor spacebars

试图制作一些简单的把手帮手

Handlebars.registerHelper('if_eq', function(context, options) {
  if (context == options.hash.compare)
    return options.fn(this);
  return options.inverse(this);
});
Run Code Online (Sandbox Code Playgroud)

得到这个错误.

ReferenceError: Handlebars is not defined
Run Code Online (Sandbox Code Playgroud)

什么是正确的方法.

cio*_*ddi 5

Handlebars对象仅在客户端上可用.因此,请确保您已经if (Meteor.isClient) { }包含了帮助程序注册代码