A directive for making a plus/minus input based on the work of Maikel Daloo.
http://Firestitch.github.io/angular-counter/
- required: Bootstrap for styling
See bower.json
and index.html
in the gh-pages
branch for a full list / more details
-
Install with bower:
bower install angular-counter
-
Include
counter.min.js
orcounter.js
in your html. -
Include the module in angular (i.e. in
app.js
) -Firestitch.angular-counter
angular.module('myApp', [ 'ngRoute', 'ngSanitize', 'ngTouch', 'ngAnimate', ... 'Firestitch.angular-counter' ])
-
See the
gh-pages
branch, filesbower.json
andindex.html
for a full example.
See the counter.js
file top comments for usage examples and documentation
https://github.com/Firestitch/angular-counter/blob/master/counter.js
Attribute | Default | Description |
---|---|---|
min/data-min | null | A minimum value, never to go below. |
max/data-min | null | A maximum value, never to go above. |
step/data-step | 1 | How much to increment/decrement by. |
addclass/data-addclass | null | Add a class to the container. |
width/data-width | null | Set the width of the input field. |
editable/data-editable | false | Whether the field is readyonly or not. By default, it's readonly. |
<div fs-counter value="someValue"
data-min="0"
data-max="100"
data-step="1"
data-addclass="someClass"
data-width="130px"
data-editable
></div>
- Fork this repo.
git checkout gh-pages
- run
npm install && bower install
- write your code then run
grunt
- git commit your changes
- run
- copy over core files (.js and .css/.less for directives) to master branch
git checkout master
git checkout gh-pages counter.js counter.min.js counter.less counter.css counter.min.css
- update README, CHANGELOG, bower.json, and do any other final polishing to prepare for publishing
- git commit changes
- git tag with the version number, i.e.
git tag v1.0.0
- Create a pull request.