ng-reset-on directive
Resets a field to its initial value (or cleans) when given scope expression is true.Demo
Just visit https://waldirpereira.github.io/angular-reset-on/example!
Installation
Install with Bower
$ bower install angular-reset-on
Install with NPM
$ npm install angular-reset-on
Manual download
Just import the angular-reset-on.js
file on dist
directory to your project.
Usage
You must include the module as a dependency of yours, something like:
.js
angular.module('myModule', ['ng-reset-on'])
.html
<body ng-app="myModule"> <div ng-controller="Ctrl"> <input type="text" ng-model="thisField" ng-reset-on="anotherField === 1" mode="reset" /> </div></body>
Options
ng-reset-on
: AngularJS expression (required)mode
: (default:clean
)reset
: resets the field to its initial valueclean
: cleans the field
Changelog
See CHANGELOG.md
Contribution
- Using Gulp as build tool
- Uses jasmine 2.5.2 in writing unit test specs
gulp
to build the projectgulp test
to run unit tests- Update
README.md
andCHANGELOG.md
to reflect the new changes - Update the version number of
package.json
andbower.json