Coder Social home page Coder Social logo

angular-numeric-directive's Introduction

angular-numeric-directive

NPM

Build Status Code Climate Test Coverage NPM

This angular directive prevents the user from entering non-numeric values.

  • There are checks on min and max values. When the value falls below the minumum the value is set to the minumum value. When the value exceeds the maxiumum, the value is set to the maximum. If the limit-min or limit-max attributes are set to false, the min or max values remain untouched.
  • Formatting is done on the blur event; thousand separator and decimal are based on the current Angular locale.
  • The number of decimals can be set.

Install:

bower install angular-numeric-directive --save

npm install angular-numeric-directive --save

Usage:

  1. Include the numeric-directive as a dependency for your app.

    angular.module('myApp', ['purplefox.numeric'])
  2. Use the directive in your view:

<input numeric min="-20" max="100" decimals="3" />

Attributes

max: maximum input value. Default undefined (no max)

min: minimum input value. Default 0.

decimals: number of decimals. Default 2.

formatting: apply thousand separator formatting. Default true.

limit-max: limit input to max value (value is capped). Default true. If set to false, the angular validations can be done like normal.

limit-min: limit input to min value (value is capped). Default true. If set to false, the angular validations can be done like normal.

angular-numeric-directive's People

Contributors

epeschier 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.