Somehow the checkbox in my Ember app is always initially checked.
...
{{#each model.fields}}
...
{{input type="checkbox" checked=isOptional}}
The fields array is an attribute in my model. Each object in fields array has an attribute called isOptional, which can be "true" or "false".
For some reason, regardless of the value of isOptional, the checkbox is initially checked.
If I check the checkbox manually, the isOptional flag will actually be changed. So the binding works except for detecting the initial value.
Any help is much appreciated, thanks!
Edit: As discussed in comments, the problem was because my model was returned by Ember.$.getJSON(), which has "false" in quotes and was interpreted as true value, resulting in checked checkboxes. I resolved this by over-writing the boolean values:
model.fields.forEach(function(field, i) {
Ember.set(field, 'isOptional', (field.isOptional == 'true'));
});