I’ve implemented text field that shows an x button when u start typing so that u can click it to clear the field. I’ve managed to figure out how to make the x button show and become clickable etc, and when the click happens I do txtEmail.value = ‘’, however it doesn’t clear the corresponding ng-model. How can I make my clearEmail function clear out the corresponding ng-model as well as the input box?
My HTML:
My Controller:
$scope.showEmailX = function() {
return txtEmail.value !== ‘’;
};
$scope.clearEmail = function() {
txtEmail.value = ‘’;
};