An AngularJS directive for clearing HTML inputs using clear icon without any external dependencies.
Feature list:
- clears HTML input.
- validation friendly (resets input to default state).
- No external dependencies (pure Angular).
- Manual method
- Download clear-icon directive from GitHub
- Using Bower
bower install clear-icon
- Include it in your main page (Usually it should be index.html)
- Add clearIconModule as a dependency in your main module.
- Example: If your app name is 'myApp' you can add clearIconModule as a dependency like below
angular.module('myApp',['clearIconModule']);
And here's some code! :
<body ng-app="myApp">
<input type="text" ng-model="test" clear-icon>
</body>