简体   繁体   English

如何通过Ember.js中的操作将多个值从视图传递到控制器?

[英]How to pass multiple values from view to controller trough an action in Ember.js?

I have the following text input 我有以下文字输入

<input type="text" name="item-name" value={{item.name}} onblur={{action "confirmName" value="target.value"}} />

How can I pass not only target.value but also the related item to confirmName ? 我怎样才能将target.value以及相关项目传递给confirmName

What should I edit? 我该怎么编辑?

I found how to do it: 我发现了怎么做:

onblur={{action "confirmName" item1 item2}}

Unfortunately it seams impossible to pass the value.target. 不幸的是,接缝无法通过value.target。

The action arguments are given this way: 动作参数以这种方式给出:

actions: {
    confirmName: function(item1, item2, event) {
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM