frog frog - 6 months ago 68
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.


Assuming you are using ng-model:

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