문제

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);
});

Getting this error.

ReferenceError: Handlebars is not defined

What's the correct way to do it.

도움이 되었습니까?

해결책

the Handlebars object is only available on the client. So make sure you have if (Meteor.isClient) { } wrapped around the helper registration code

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top