GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
See the fiddle: http://jsfiddle.net/dvcby/1/
To be clear: the problem arises when you have (1) a computed property that depends on a property on '@each' and (2) an observer or a binding either on that property or another property down the line that ultimately depends on the first property
UPDATE: Simply directly observing @each.blah without any intermediary computed properties has the exact same behaviour.
Not only does the observer never fire, but the length property gets reported as 0 regardless of its true value. Remove the .observes(), and the length property is restored.
Additional chaining of computed properties in place of an observer does NOT have the same effect. A binding DOES have the same effect.
OK so it turns out that the problem is the length property.
Because init doesn't call arrayContentDidChange, length never gets expired, even though the content (in array terms) is getting set in init, so the length goes from 0 to x without any notifications.
See http://jsfiddle.net/rc9cr/6/ for an updated jsfiddle showing expected behaviour once the arrayContentDidChange call is added.
Closing in favor of #2286.