Ember passing arguments to action using {{input}} helper.











up vote
0
down vote

favorite












Let's take this case



 {{input value=firstName key-press="updateFirstName"}} 


In this case, value will be passed as an argument to the action "UpdateFirstName".



Now i want to pass an object "Person" also to the action. How do i do it?



I've tried



 {{input value=firstName key-press="updateFirstName Person"}} 


but no use. Can someone help?










share|improve this question


















  • 1




    Something like key-press=(action (action 'updateFirstName' person)) and person will be in first argument
    – Gennady Dogaev
    2 days ago












  • Worked! Thanks a lot, man.
    – Anonymous2018
    2 days ago










  • Hey, I'm using <input type="text" value={{person.name}} onkeypress={{action 'functionName' person value}}>.. But value is not getting passed..
    – Anonymous2018
    yesterday










  • <input type="text" value={{person.name}} onkeypress={{action (action 'functionName' person) value="target.value"}}>
    – Gennady Dogaev
    yesterday















up vote
0
down vote

favorite












Let's take this case



 {{input value=firstName key-press="updateFirstName"}} 


In this case, value will be passed as an argument to the action "UpdateFirstName".



Now i want to pass an object "Person" also to the action. How do i do it?



I've tried



 {{input value=firstName key-press="updateFirstName Person"}} 


but no use. Can someone help?










share|improve this question


















  • 1




    Something like key-press=(action (action 'updateFirstName' person)) and person will be in first argument
    – Gennady Dogaev
    2 days ago












  • Worked! Thanks a lot, man.
    – Anonymous2018
    2 days ago










  • Hey, I'm using <input type="text" value={{person.name}} onkeypress={{action 'functionName' person value}}>.. But value is not getting passed..
    – Anonymous2018
    yesterday










  • <input type="text" value={{person.name}} onkeypress={{action (action 'functionName' person) value="target.value"}}>
    – Gennady Dogaev
    yesterday













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Let's take this case



 {{input value=firstName key-press="updateFirstName"}} 


In this case, value will be passed as an argument to the action "UpdateFirstName".



Now i want to pass an object "Person" also to the action. How do i do it?



I've tried



 {{input value=firstName key-press="updateFirstName Person"}} 


but no use. Can someone help?










share|improve this question













Let's take this case



 {{input value=firstName key-press="updateFirstName"}} 


In this case, value will be passed as an argument to the action "UpdateFirstName".



Now i want to pass an object "Person" also to the action. How do i do it?



I've tried



 {{input value=firstName key-press="updateFirstName Person"}} 


but no use. Can someone help?







html ember.js ember-data






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









Anonymous2018

287




287








  • 1




    Something like key-press=(action (action 'updateFirstName' person)) and person will be in first argument
    – Gennady Dogaev
    2 days ago












  • Worked! Thanks a lot, man.
    – Anonymous2018
    2 days ago










  • Hey, I'm using <input type="text" value={{person.name}} onkeypress={{action 'functionName' person value}}>.. But value is not getting passed..
    – Anonymous2018
    yesterday










  • <input type="text" value={{person.name}} onkeypress={{action (action 'functionName' person) value="target.value"}}>
    – Gennady Dogaev
    yesterday














  • 1




    Something like key-press=(action (action 'updateFirstName' person)) and person will be in first argument
    – Gennady Dogaev
    2 days ago












  • Worked! Thanks a lot, man.
    – Anonymous2018
    2 days ago










  • Hey, I'm using <input type="text" value={{person.name}} onkeypress={{action 'functionName' person value}}>.. But value is not getting passed..
    – Anonymous2018
    yesterday










  • <input type="text" value={{person.name}} onkeypress={{action (action 'functionName' person) value="target.value"}}>
    – Gennady Dogaev
    yesterday








1




1




Something like key-press=(action (action 'updateFirstName' person)) and person will be in first argument
– Gennady Dogaev
2 days ago






Something like key-press=(action (action 'updateFirstName' person)) and person will be in first argument
– Gennady Dogaev
2 days ago














Worked! Thanks a lot, man.
– Anonymous2018
2 days ago




Worked! Thanks a lot, man.
– Anonymous2018
2 days ago












Hey, I'm using <input type="text" value={{person.name}} onkeypress={{action 'functionName' person value}}>.. But value is not getting passed..
– Anonymous2018
yesterday




Hey, I'm using <input type="text" value={{person.name}} onkeypress={{action 'functionName' person value}}>.. But value is not getting passed..
– Anonymous2018
yesterday












<input type="text" value={{person.name}} onkeypress={{action (action 'functionName' person) value="target.value"}}>
– Gennady Dogaev
yesterday




<input type="text" value={{person.name}} onkeypress={{action (action 'functionName' person) value="target.value"}}>
– Gennady Dogaev
yesterday

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343637%2fember-passing-arguments-to-action-using-input-helper%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343637%2fember-passing-arguments-to-action-using-input-helper%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]