Charles
Charles

Reputation: 11768

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?

What should I edit?

Upvotes: 3

Views: 996

Answers (1)

Charles
Charles

Reputation: 11768

I found how to do it:

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

Unfortunately it seams impossible to pass the value.target.

The action arguments are given this way:

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

Upvotes: 3

Related Questions