I'm trying to use Ember's Handlebars engine for a not UI related purpose. I have a series of text templates (basically placeholders + static text), like
Order number {{number}} / {{year}}
I'm using the following code in a controller function (simplified here for the sake of the example):
formattedTitle: function(order) {
var orderTitle = "Order number {{number}} / {{year}}";
var template = Handlebars.compile(orderTitle);
return template(order);
}
offer is a Ember.data record, containing both fields.
When I run the function the resulting string only contains the static text:
Order number /
It only works with the {{id}} property, probably because you can do order.id on the Ember.data record, but not order.number (you have to use get - order.get("number"))
Any idea how to solve this?