-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(uiSelectController): invoke onRemove callback method for single s… #1977
base: master
Are you sure you want to change the base?
Conversation
test/select.spec.js
Outdated
scope.$model = $model; | ||
}; | ||
|
||
var el = compileTemplate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloud you use the createuiSelect function instead of the comileTemplate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no problem. Updated test to use createUiSelect
instead.
…elect on clear selection Closes angular-ui#1225
ctrl.select(null); | ||
$event.stopPropagation(); | ||
$timeout(function() { | ||
ctrl.onRemoveCallback($scope, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this function been refactored to be on the uiSingleSelect
directive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean then the clear
function. As the uiSelectMultiple
has his own remove
function. I think it would be good to keep this kind of functionality on the correct place. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jefiozie I see what you are saying. I might be overlooking something here but it seems to me that uiSelectMultiple
has the removeChoice
method on its controller and then the uiSelectMatchDirective
view uses the uiSelectMultiple
controller to call it like so ng-click="$selectMultiple.removeChoice($index)"
.
Currently uiSingleSelect
doesn't have a controller so I would have to add the method directly to the scope of uiSingleSelect
in the link function. Then I would call it from the uiSelectMatchDirective
single view like so ng-click="remove($event)"
. I just haven't seen too many methods bound directly to the scope in the library so I wasn't sure if this was correct. What do you think?
Anything new on this one? It's really annoying there is no way to know when clear is called... |
…elect on clear selection
Closes #1225