Anyone know how to clear the selected value of an ui-select box in angular?
I want the functionality of select2 where you have a small x in the selectbox. Doesn\'t l
You could add a small X button when you display the selection.
{{$select.selected.name}}
Then you stop the click event from bubbling up and trigger the open event. And you clear the field by overwriting the selected model.
$scope.clear = function($event) {
$event.stopPropagation();
$scope.country.selected = undefined;
};
Here's the plnkr. http://plnkr.co/edit/qY7MbR