I have an object in witch some of the values are strings containing spaces. Something like this:
object = {
"group of people": [
{
(...)
}
],
"another group of people": [
{
(...)
}
]
}
And I'm trying to use it with the handlebars helper block in my view (index.hbs) like this:
{{#each group of people}}
(...)
{{/each}}
But I get an error (of course), because of the spaces on "group of people". I've tried the following cases without any success:
{{#each "group of people"}}
{{#each 'group of people'}}
{{#each group%20of%20people}}
{{#each groupofpeople}}
{{#each group of people}}
Any idea on how to get this working?
To use a property that has spaces, you can decorate it with [].
e.g.
Given helpers:
obj = {
'property with spaces': 'hello'
};
Template:
<p>{{[property with spaces]}}</p>
Would generate:
<p>hello</p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With