Using handlebars.js templates with backbone.js. Have a view connected to a model that contains only an integer value. It is not an object, it is just an integer value.
Normally while using handlebars, it is assumed that all the data is inside an encapsulating object, so in order to access a field inside the template, I can just do this:
{{property_name}}
What do I do if there are no properties and I just want to display the object value itself? Id there a way to do this using handlebars.js templates, or do I need to manipulate the integer value into an object using the parse() method in the model?
The keyword you are looking for is
{{this}}.Curiously enough,
{{.}}works also, thanks to the relative context support for paths like../parent.