vendredi 1 mai 2015

get the value of an input on changed value in Ember

I have the following action in my controller:

actions:{
    doSomething:function(a){console.log("do something",a)}
}

In my template I have:

{{input value=50 name=variableName action="doSomething" on="input"}}

However the function never fires when I change the input value, ie by typing or deleting the placeholder value of 50.

What am I doing wrong and how do I get the changed value of the input box?

Note: I use on="input" because I want to do something when the input value changes, but let me know if I should be using a different event. Using key-press results in the method firing, but the input value printed to the console is the 'before-any-changes' input value. I need the input value after someone has typed into the field. I tried using key-up but the method doesn't fire.




Aucun commentaire:

Enregistrer un commentaire