mercredi 19 juillet 2017

How to get handlebars to call get() method on context?

I'm using handlebars by itself with an Ember Object as context. I'd like it so that it works as it does in Ember+HTMLBars, where it seemingly calls get() instead of assuming context is a POJO.

var template = Handlebars.compile("My ember object: ");
var str = template(Ember.Object.create({value: "hello"}));

assert.equal(str, "My ember object: hello"); // Fails. str == "My ember object: "

Is there a way to have handlebars call get()?




Aucun commentaire:

Enregistrer un commentaire