i need to template with handlebars an array of json object:(by chrome console) [object,object,object,object] where every object is composed by this property:name,surname,ecc.
I’ve understood that is impossible to put array of object in handlebars but we must create an unique object with all property of all object of array.
Can anyone suggest me a function to create it
You could set your array as a property of a wrapper object when calling the template.
For example, with
objectsas the holding propertyand your template can use this property as follows:
And a demo http://jsfiddle.net/YuvNY/1/
Or you could pass directly the array to the template and call the
eachhelper with the context set to.(a dot)http://jsfiddle.net/nikoshr/YuvNY/32/