samedi 3 décembre 2016

Dynamic component creation in ember@2.10.0

I have this piece of code in an addon that worked before Glimmer was introduced but is now failing since updating to ember@2.10.0.

        const el = document.createElement('div');
        Component.create({
          model: model,
          layout: self.get('suggestionTemplate'),
        }).appendTo(el);
        return el;

I am now getting the following error

ember.debug.js:8722 Uncaught TypeError: Cannot read property 'hasRegistration' of undefined(…)

This is happening because the owner is "undefined" deep within the ember code when running the "hasHelper" function.

enter image description here

Is there something I can pass to the component creation to prevent this happening or is there a better way to do this? Essentially I need the RAW DOM for a third party API.




Aucun commentaire:

Enregistrer un commentaire