mardi 27 janvier 2015

Appending Ember Component to a DOM element not managed by Ember

I would like to append an Ember Component ComponentB to a DOM element which is generated by some non-Ember UI library on didInsertElement of ComponentA, resulting in something like



<div class='ember-view component-a'>
<div class='i-know-nothing-of-ember'>
<div class='ember-view component-b'></div>
</div>
</div>


I am aware of appendTo(element) method, however it fails with assertion



You cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.



I also tried calling createElement on component B and then appending it to DOM via jQuery - which kind of works, however in the end it fails with error



Cannot set property '_elementInserted' of null



See http://ift.tt/1znzrcz


What is the proper way to achieve the above; if possible actions and other behaviours should be as if i-know-nothing-of-ember would be generated by Component A template.





Aucun commentaire:

Enregistrer un commentaire