如何使用ember和require.js对handlebars helper进行编码

时间:2013-07-12 07:51:51

标签: ember.js requirejs handlebars.js

define([ "handlebars","ember"], function(Handlebars,Ember) {
  Ember.Handlebars.registerHelper('judgeStatus', function(value) {
    alert(value);
    var result = value;
    return new Handlebars.SafeString(result);
  });
});

Uncaught [object Object] handlebars.js:706 verifyMatch

当我使用require.js如何编码时,

需要Handlebars Helper吗?

1 个答案:

答案 0 :(得分:1)

像这样......

define(["ember",], function(Ember) {
    Ember.Handlebars.registerBoundHelper('judgeStatus', function(value) {
      var result = '';      
      return new Ember.Handlebars.SafeString(result);
    });
});