I believe it is because once you click on a checkbox for the first time, isChecked
becomes true
, which updates every checkbox that relies on that variable.
One way to get around this is to set the isChecked
attribute on the Company model:
App.Company = DS.Model.extend({
name: DS.attr('string'),
people: DS.hasMany('person', {async: true}),
isChecked: false
});
And your checkbox code would be {{input type="checkbox" checked=company.isChecked}}
.
Then you can easily get which ones are checked by iterating over the content.
Here is the updated JSbin with my suggestions: