@each
in deeply nested computed property JS-0780Ember does not allow deeply-nested computed property dependent keys with @each
. At runtime, it will show a warning about this.
You should use @each
only one level deep otherwise it will create a complex equation and effect your application performance.
export default Component.extend({
displayNames: computed('[email protected]', function () {
return this.todos.map((todo) => todo.owner.name);
})
});
export default Component.extend({
displayNames: computed('[email protected]', function () {
return this.owners.mapBy('name');
}),
owners: computed('[email protected]', function () {
return this.todos.mapBy('owner');
})
});