Giter Site home page Giter Site logo

angular-price-format's Introduction

Jquery Price format directive for AngularJs

Finance-e modifies for angularjs directive, based on directive founded in stack overflow http://stackoverflow.com/questions/19576202/angular-input-field-with-a-currency-mask-directive-for-money-format-on-the-fly

Requirements

  • Jquery
  • AngularJS

Install

You can get it from Bower

bower install angular-price-format

This will copy the angular-price-format files into a bower_components folder, along with its dependencies. Load the script files in your application:

Usage

Include angular, jquery and angular-price-format scripts in your project:

<script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="bower_components/angular-price-format/dist/angular-price-format.min.js"></script>

Create your controller with some proprety (include angular-price-format dependence)

<script>
    angular.module('myPrivateModule', ['angular-price-format']).
        controller('priceFormatCTRL', ['$scope', function($scope) {
        $scope.test1  = 0;
        $scope.test2  = 0;
        $scope.test3  = 0;
    }]);
</script>

<div ng-app="priceFormat" id='examples'>
    Basic Usage
    <input type="text" ng-model="test1" pformat/> <br/>

    Changing options
    <input type="text" ng-model="test2" pformat prefix="R$ " cents=',' thousands='.'/>
</div>

Grunt Serve

We have one grunt task to run server (the index file run live examples)

grunt run

It's equal to run separately:

  • grunt connect:server : giving you a development server at http://localhost:9002/.
  • grunt watch : will automatically build your demo.

angular-price-format's People

Contributors

tigredonorte avatar mmbfreitas avatar mrprompt avatar

Watchers

James Cloos 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.