I am trying to add and push additional objects in my application. I have reproduced the case in this jsBin
To Achieve that I have followed this tutorial, which does exactly what I want.
I have a list of invoices and any invoice is composed by transactions. I can create a new invoice in my invoices create route where I want to add and push any single transaction.
actions: {
add: function() {
var newTransaction = Ember.Object.create({
name: "New Transaction",
quantity: null,
selectedFare: null,
isDone: false
});
return this.get("content").pushObject(newTransaction);
}
In my template this is how it looks
<tr>
{{#each controller}}
<td>{{name}} {{input type=checkbox value=isDone checked=isDone}} {{input valueBinding=quantity}} {{view Em.Select prompt="test" contentBinding="controllers.fare.content" optionLabelPath="content.name" optionValuePath="content.id" selectionBinding="controllers.fare.selectedFare" }}</td>
{{/each}}
</tr>
Unfortunately I can not really see the error in the console. I don't know what is going wrong.
If from the template you remove{{#each controller}}{{/each}}
, you can see one single transaction.
What's wrong in my code?