When specifying a positional parameter for a component class in ember you need to open the class again (for example, below) for it to work, you cannot include it in the initial declaration (at least from what I saw in the examples and my own experience) .
import Ember from 'ember'; const component = Ember.Component.extend({ }); component.reopenClass({ positionalParams: ['post'], }); export default component;
If you do this in a single declaration (e.g. below), it will not work
import Ember from 'ember'; export default Ember.Component.extend({ positionalParams: ['post'], });
Questions
- Was this something missing from the design process? Or was it intentional (perhaps to discourage use)?
- Is it because it's some kind of class attribute? Is there a way to specify class attributes in a class declaration?
It just seems rude that I cannot make it part of the same expression and must assign the class to a variable, open it again, and then finally export it.
Version
source share