Array#@each

@eachpublic

Defined in packages/ember-runtime/lib/mixins/array.js:555

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(){
  ...
});
doc_EmberJs
2016-11-30 16:48:33
Comments
Leave a Comment

Please login to continue.