vendredi 22 novembre 2019

How to pass input data from template to the component class in ember?

I am trying to pass the data which is in the input field to the component class

This is my component-class alpha.js

@tracked choice;

    @action next() {
        this.choice = this.get('this.choice');
        console.log(this.choice);
    }

This is my template alpha.hbs

    <Input @value= type="text"  />
    <button onclick=>Next</button>

I am getting Uncaught TypeError: this.get is not a function

Any help would be appreciated. Thanks




Aucun commentaire:

Enregistrer un commentaire