dimanche 4 janvier 2015

Ember: {{link-to}} helper error when in {{each}} helper

The link-tohelper return the following error:



Uncaught Error: each doesn't match link-to - 5:10


The template:



<script type="text/x-handlebars" id="actions">
<div class='container-fluid'>
<div class="row"> <!-- -->
<div class="col-md-6 col-lg-4"> <!-- -->
{{#each action in model}}
{{link-to 'action' action}}{{action.id}}{{/link-to}}
{{/each}}
{{outlet}}
</div>
</div>
</div>
</script>


The router:



App.Router.map(function() {
this.resource('application', function() {
this.resource('actions', function() {
this.resource('action', { path: '/:action_id'});
});
});


The route:



App.ActionsRoute = Ember.Route.extend({
model: function() {
return this.store.findAll('action');
//return this.modelFor('user').get('actions');
},

setupController: function (controller, model) {
controller.set('model', model);
},

});


I cannot find what is wrong.





Aucun commentaire:

Enregistrer un commentaire