0

I am having some trouble accessing properties passed to my Ember component, which is as follows:

import Ember from 'ember';

export default Ember.Component.extend({
    isRowEditorActive: function() {
        return this.get('items').length > 0;
    }.property('items'),

    actions: {
        // My actions here
    }
});

The items (list of strings) that I pass in, can be accessed without problems within the template {{line-items-table items=['asd', 'asd']}}

However trying to get them within the component just returns undefined. Any suggestions?

JB2
  • 1,587
  • 2
  • 24
  • 40
  • You should put it in a wrapper object in controller> lineItemParams: { items: ['foo', 'bar'] } {{line-items-table params=lineItemParams}} – kristjan reinhold Mar 30 '16 at 07:21

1 Answers1

1

As @kristjan says, you'll need to define your items for the line-item-table in the parent.

This is due to that the current version of handlebars don't support inline arrays, https://github.com/wycats/handlebars.js/issues/1058

Community
  • 1
  • 1
Carl
  • 740
  • 8
  • 18