@eachpublic
Returns a special object that can be used to observe individual properties on the array. Just get an equivalent property on this object and it will return an enumerable that maps automatically to the named key on the member objects.
@each
should only be used in a non-terminal context. Example:
myMethod: computed('posts.@each.author', function(){ ... });
If you merely want to watch for the array being changed, like an object being replaced, added or removed, use []
instead of @each
.
myMethod: computed('posts.[]', function(){ ... });
Please login to continue.