mardi 27 janvier 2015

Can't use Handlebars to generate class name

I'm using Ember.js with a Rails app, but when I want to dynamically change class name depending on the data, I get an error. Here is the Handlebars file:



<ul id="data-all" class="list-items">
{{#each datum in data}}
<li class="list-item">
{{#link-to 'data.datum' datum.name classNames="link-item"}}
<span class="datum-last-action datum-{{datum.name}}">{{datum.name}}</span>
{{/link-to}}
</li>
{{/each}}
</ul>


And the generated errors:



Uncaught Error: Assertion Failed: An error occured while setting up template bindings. Please check for invalid markup or bindings within HTML comments.
Uncaught Error: Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.


All the doc I found don't give special warning using this, so why does this occure?


Thanks





Aucun commentaire:

Enregistrer un commentaire