Git Product home page Git Product logo

angular-counter's Introduction

AngularJS directive for incrementing a counter form input field

A directive for making a plus/minus input based on the work of Maikel Daloo.

Demo

http://Firestitch.github.io/angular-counter/

Dependencies

  • required: Bootstrap for styling

See bower.json and index.html in the gh-pages branch for a full list / more details

Install

  1. Install with bower:

    bower install angular-counter
  2. Include counter.min.js or counter.js in your html.

  3. Include the module in angular (i.e. in app.js) - Firestitch.angular-counter

    angular.module('myApp', [
        'ngRoute',
        'ngSanitize',
        'ngTouch',
        'ngAnimate',
        ...
        'Firestitch.angular-counter'
    ])
  4. See the gh-pages branch, files bower.json and index.html for a full example.

Documentation

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>

Development

  1. Fork this repo.
  2. git checkout gh-pages
    1. run npm install && bower install
    2. write your code then run grunt
    3. git commit your changes
  3. copy over core files (.js and .css/.less for directives) to master branch
    1. git checkout master
    2. git checkout gh-pages counter.js counter.min.js counter.less counter.css counter.min.css
  4. update README, CHANGELOG, bower.json, and do any other final polishing to prepare for publishing
    1. git commit changes
    2. git tag with the version number, i.e. git tag v1.0.0
  5. Create a pull request.

angular-counter's People

Contributors

seydoggy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.