Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4836

Ember handlebars hyphen

$
0
0

@wowember wrote:

I’m getting template error when I use a key with a hyphen in it. Handlebars supports this … Does anyone know how to get that working with Ember?

For an object like this:

   foo =  { "bars": [
                      {"hyphen-key": "value"}
                    ]
          }

and template like this:

{{#each foo.bars as |bar|}}
	<div>{{bar['hyphen-key']}}</div>
{{/each}}

The error is:

Parse error on line 64:
...g >{{foo['hyphen-key']}
-----------------------^
Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'

Broccoli Plugin: broccoli-persistent-filter:TemplateCompiler

Thanks

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4836

Trending Articles