-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Ember bound action has issues with iterated context and late binding #4659
Comments
Additionally, I'm not sure if it's appropriate to switch this assert to false now, https://github.com/emberjs/ember.js/blob/master/packages_es6/ember-routing/lib/helpers/action.js#L97 |
@kingpin2k #4658 addresses this. |
Closing in favor of #4658. |
I'm thinking we can do something like this:
instead of
I'll need to check out some additional use cases, I've checked out with other params, without params, not bound and it seems to be fine so far, but I'll keep investigating |
@kingpin2k #4658 changed this from target to the current context (it is merged into master and beta branch now). |
@rjackson that only works if the property exists in the current context, aka it would still break if you used
it would then do a get for |
@kingpin2k - Great point. Thanks for the PR. |
Hi, i am getting this issue: <button type="button" class="btn btn-default" {{ action doSearch "abc" }}>Return |
@NvnTiwari Like the error mentioned, it was not able to resolve actionName to call. if doSearch is property then either it should return functionName in string or |
Thanks @kumkanillam now its working. |
If you bind during an each, the property is assumed to be in the current context, as opposed to the possible iterated context.
Not Working: http://emberjs.jsbin.com/saturubu/3/edit & http://emberjs.jsbin.com/saturubu/4/edit
You can work around it by using an item controller (giving a real context to the section). Unfortunately you must force the context (meaning you can't say
item in controller
, or it will search forcontroller.item.myAction
.Working: http://emberjs.jsbin.com/saturubu/1/edit
The text was updated successfully, but these errors were encountered: