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
Note: if we used tagging and tagging-label="false" in that case allow-clear functionality not work.
Custom clear functionality
HTML Code
{{$select.selected.description || $select.search}}
Controller action Code
function clear($event, $select){
//stops click event bubbling
$event.stopPropagation();
//to allow empty field, in order to force a selection remove the following line
$select.selected = undefined;
//reset search query
$select.search = undefined;
//focus and open dropdown
$select.activate();
}