Here are two doubts with their solutions that I had today while working with ember-decorators
that could be useful for someone else:
what’s the recommended strategy for handling mixins with e-decorators?
I found the answer in a @pzuraq’s post. Using export default class FooComponent extends Component.extend(FooMixin)
.
How to set up the layout property of a component with e-decorators? (in-repo-addon)
@chriskrycho suggested me this way
import Component from '@ember/component';
import layout from 'my-addon/templates/my-component';
export default class MyComponent extends Component {
layout = layout;
}
Just layout
works too but you get an eslint style error because of a no-unused-vars
in the import. So his way is better. Also, Babel’s support for class properties must be enabled.