frog frog - 2 months ago 12
AngularJS Question

angular Clear icon inside input text

Is it possible to do something like this -> Clear icon inside input text

only in angular.js? I need it for my angular application and due to various private scopes I can't get it working with jQuery.

Answer

Assuming you are using ng-model:

<div class="container">
    <input type="text" ng-model="someTextField" />
    <button ng-click="someTextField = ''">x</button>
</div>
Comments