I\'ve noticed that the enumerable mixin has computed properties that depends on the \'[]\'
property, while ember arrays also have the \'@each\'
propert
Use @each
if you need to observe properties of array elements
@each
supports observing properties of the elements inside the array. For example, people.@each.name
. The bracket notation does not support this. Here is a jsbin demo.
@each
is a property of Array instances that returns an EachProxy instance that handles the delegation. On the other hand, []
simply returns this.
Use []
if you need it to work on non-Array enumerables
According to the ember changelog, the bracket notation was made defunct in favor of @each
in ember 0.9.4, but then re-enabled in 0.9.8. The commit that re-enables it indicates that []
can be used for non-Array enumerables such as Ember.Set
instances. jsbin demo.