-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is 'array.@each' correct? #2016
Comments
@joliss that works fine, though it's slightly more efficient to do |
Similar thought, |
observing array.length and array.[] are the same performance wise, they are both notified during .replace() which is what all mutations to an Ember.MutableArray go through. array.@each creates an EachProxy which installs observers, it is more for observing properties of the objects in an array. |
length is only notified though if the length ACTUALLY changes. Swapping out an element for instance would NOT notify length, while it WOULD notify []. edit: 24 days ago... I have no idea why this showed up at the top of the list. very strange. |
I still see people making this error. |
I sometimes see people write
(function() { ... }).property('array.@each')
. Is that actually a correct way to bind to each element of the array?Either way, we should clarify that on http://emberjs.com/guides/object-model/computed-properties-and-aggregate-data/ and perhaps http://emberjs.com/api/classes/Ember.MutableArray.html#property__each.
The text was updated successfully, but these errors were encountered: