How can I share a template between two components using the Ember CLI?

I have two components: SpecialButtonComponent and SpecialButtonDerivativeComponent .

The SpecialButton component automatically uses the template found in /app/templates/components/special-button.hbs .

I would like SpecialButtonDerivativeComponent use the same template, but so far I have had no luck with this technique:

 // app/components/special-button-derivative.js import SpecialButtonComponent from './special-button'; export default SpecialButtonComponent.extend({ templateName: 'components/special-button' }); 

I also tried using layoutName instead of templateName , but still no luck. Any ideas?

+3
source share
1 answer

Components do not have templateName .

I would try setting the layout to null and then specify layoutName .

+5
source

All Articles