Closed sharathm89 closed 6 years ago
Maybe just clear the model that the control is bound to? I mean, reset your ngModel. But if what you're after is removing the selected item from the list of items, then remove it from the collection of items and Angular should take care of the rest. Which do you want and how did it work?
if you see the above image i have selected Mr now if i feel that i am not sure about the prefix then i have to clear it basically leave empty. But in current control once selected there is no provision to de-select it or make it empty or reload the page and do it carefully. But we can't say user's to reload it.
As of now there is no built-in functionality to clear selected items but you could add a button next to it that when clicked, sets the ng-model
property to null
or undefined
.
Once i search and select the item how can i clear it, if i feel i need to leave it blank