This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Adding ui and event arguments to attribute callback expressions#558
Open
filipkis wants to merge 2 commits intoangular-ui:masterfrom
Open
Adding ui and event arguments to attribute callback expressions#558filipkis wants to merge 2 commits intoangular-ui:masterfrom
filipkis wants to merge 2 commits intoangular-ui:masterfrom
Conversation
Bringing up to date with the head fork
Attribute expression callbacks now also have access to the event and ui arguments. For example you could specify ui-sortable-update="myCallback($event, $ui)".
Author
|
P.S. I've originally tried to submit this PR as #557, but had trouble with jshint (there's a post commit hook that messes up the quotes), that's why I created a new one to have a cleaner history. |
Author
|
Any chance this gets merged into main branch. It's rather simple, but IMHO valuable addition, so it shouldn't be hard to review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently if you specify an expression that's not just a reference to a function such as
ui-sortable-update=doSomething()you have no way of accessing theeventanduiarguments passed to callbacks.With this PR I've made those two arguments available as
$eventand$uiparameters in the scope of the expression execution. So now you could doui-sortable-update=doSomething($event, $ui)or evenui-sortable-update=doSomething($event, $ui.item.sortable).