mercredi 6 novembre 2019

How do I get `this.args` within a component function? I get "TypeError: this is undefined"

I'm writing some Octane-style components in Ember v3.13, together with the ember-render-modifier. However, when the function tied to did-insert is called, I get TypeError: this is undefined. What am I doing wrong?

Here's my component template:

<div class="cardhost-monaco-container" ></div>

And here's the component's JavaScript class:

import Component from '@glimmer/component';


export default class CodeEditor extends Component {
  renderEditor(el) {
    console.log(this.args.code)
  }
}



Aucun commentaire:

Enregistrer un commentaire