Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/459.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何将输入数据从模板传递到ember中的组件类?_Javascript_Ember.js_Ember Components - Fatal编程技术网

Javascript 如何将输入数据从模板传递到ember中的组件类?

Javascript 如何将输入数据从模板传递到ember中的组件类?,javascript,ember.js,ember-components,Javascript,Ember.js,Ember Components,我试图将输入字段中的数据传递给组件类 这是我的组件类alpha.js @tracked choice; @action next() { console.log(this.choice); } <Input @value={{this.choice}} type="radio" /> <button onclick={{action 'next'}}>Next</button> 这是我的模板alpha.

我试图将输入字段中的数据传递给组件类

这是我的组件类alpha.js

@tracked choice;

    @action next() {

        console.log(this.choice);
    }
    <Input @value={{this.choice}} type="radio"  />
    <button onclick={{action 'next'}}>Next</button>
这是我的模板alpha.hbs

@tracked choice;

    @action next() {

        console.log(this.choice);
    }
    <Input @value={{this.choice}} type="radio"  />
    <button onclick={{action 'next'}}>Next</button>

下一个
到目前为止,它还是空的


任何帮助都将不胜感激。谢谢这个
这个
谢谢!但为了澄清,我知道this.change正在从组件类调用操作。但是{{on“change”this.change}}是作为事件传递给组件类的change操作的“change”a参数吗?这是
{{on
modifiert。它基本上调用
addEventListener
change
addEventListener
的第一个参数。因此它将触发
change
事件谢谢!但为了澄清,我知道this.change正在从组件类调用操作。但是{{on“change”this.change}}是“change”这里的change操作的参数作为事件传递给组件类?这是
{on
modifiert。它基本上调用
addEventListener
,而
change
addEventListener
的第一个参数。因此它将触发
change
事件