@ImmortalDragon wrote:
Good day.
I'm writing component, which depend on model's attributes. (table row, each column - different attribute of a model)
I don't know these attributes before runtime.
So i want to use computed property, but how?columns: [{ columnHeader: 'Наименование', name: 'name' }, { columnHeader: 'Артикул', name: 'model' }], cells: Ember.computed('row.?????????'), function() { return this.get('columns').map((column) => { return Ember.Object.create({ data: this.get(`row.${column.name}`), isEditing: false }); }); }),
row.@each - not work,
row.{name,model} - work, but it's not reusable (in other model, other attributes)
i need something likerow.${someFunction()}
, but it's not work too.row is a model record
Help, please
Posts: 1
Participants: 1