vendredi 2 janvier 2015

Ember.js {{#each}} value in html tag?

So I am using Ember.js each helper and I am having trouble putting values where I want them.


Here is what I want my html to look like.



<div id="item0">
item0Value
</div>


But I can't figure out how to write this in the handlebars template.


This is what I tried.



{{#each item in array}}
<div id="item{{item.id}}">
{{item.value}}
</div>
{{/each}}


This gives me an error.


Uncaught Error: Assertion Failed: An error occured while setting up template bindings. Please check for invalid markup or bindings within HTML comments.


Is there a way to do what I want here? or is it not possible to put values inside the html tags?





Aucun commentaire:

Enregistrer un commentaire