dimanche 31 juillet 2016

Ember Component Template Extend

I want to extend ember component which is easily possible with extends. But I want to also extend the component template and add some extra html around it. Is there a way to do this ?

So basically I want to create a new component by adding some extra wrapping around current component and without losing its exiting functionality.

// component.js
import SuperComponent from 'components/super-component'
export default SuperComponent.extends({
  // some operations
});

// template.hbs
<div id="extra-div"> 
  
</div>

I am using older version of ember 1.10.
I tried referencing super component template as a partial and passing context. But seems way to hacky way to get around.




Aucun commentaire:

Enregistrer un commentaire