Reputation:
Code below is my current solution,
tagsValue: Ember.computed('tags.@each', {
get() {
const out = [];
this.get('tags').forEach((tag) => {
out.push(tag.get('value'));
});
return out;
}
}),
Is there a better way to do so?
Upvotes: 0
Views: 23
Reputation: 27397
Try code below,
tagsValue: Ember.computed('tags.@each', {
get() {
return this.get('tags').mapBy('value');
}
}),
Upvotes: 1