-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendAction() not working on 1.12 #5
Comments
Thanks so much for reporting! Will get a test in place and an update out a bit later today! |
Would love a fix 👍 |
See my PR. |
I was just thinking through the API a bit, and I'm wondering if we shouldn't rather omit an error if the values of the I was also skimming through the changelogs and I could not find any announced changes to That leaves the problem of coping with Ember pre-1.13... Given that 1.13 is the first LTS release, and Ember 2.0 is on the horizon, maybe it is worth officially supporting on 1.13 and up and making a note in the related places in the documentation that older Ember versions should only pass in strings... Wdyt @knownasilya @henrymazza ? |
@kennethkalmer The convention is to have a static API that isn't changed. The component shouldn't care what the user passes in for the action. {{my-comp myAction='usersAction'}} // in my component
this.sendAction('myAction', data);
See the improved actions rfc, https://github.com/emberjs/rfcs/blob/00ac2685c86f27d41547012903f485a4ef338d27/active/0000-improved-actions.md |
I think the events shouldn’t be exposed, it’s not very Ember_y_. The action will update a value, so just do it directly inside the component, the component exists to take away this complexity from your code. Also, it’s what every built-in ember view/component do, it sets the Example: {{range-slider value=allowance live=false step=0.10}}
{{input value=allowance type="number" step=0.10}} See how clear the API gets? Or perhaps it’s a step too far? |
@henrymazza I disagree, because Ember is headed into the "data down, actions up" methodology, like react, and this would be completely against that. It causes observer hell if you want to do anything mildly complex. |
Ok. So are they gonna change the way the input components work today? -- On 18 de junho de 2015 at 16:30:23, Ilya Radchenko (notifications@github.com) wrote: @henrymazza I disagree, because Ember is headed into the "data down, actions up" methodology, like react, and this would be completely agains that. It causes observer hell if you want to do anything mildly complex. — |
@henrymazza you will be able to do |
So -- On 18 de junho de 2015 at 17:13:19, Ilya Radchenko (notifications@github.com) wrote: @henrymazza you will be able to do <input type="text" onchange=(action 'name')> — |
sounds like a win 👍 |
Thanks for the input guys, I'll review the RFC too and see what Are we happy with only supporting 1.13 and up from this API change? |
Hmm, closed as a side-effect of merging in #6, but the question around 1.13 and API changes still hold |
At least on Ember 1.12.1 the line:
works only if you change it to:
It is,
sendAction()
must receive the name of the property that holds the action’s name as a value and not the name itself!The text was updated successfully, but these errors were encountered: