-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathtest.html
More file actions
143 lines (133 loc) · 7.9 KB
/
test.html
File metadata and controls
143 lines (133 loc) · 7.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="jquery price format directive for angularjs">
<meta name="author" content="@tigredonorte">
<title>AngularJs Price Format Directive</title>
<link rel='stylesheet' type='text/css' href='bower_components/bootstrap/dist/css/bootstrap.min.css' media='screen'/>
<link rel='stylesheet' type='text/css' href='bower_components/bootstrap/dist/css/bootstrap-theme.min.css' media='screen'/>
<link rel='stylesheet' type='text/css' href='bower_components/components-font-awesome/css/font-awesome.min.css' media='screen'/>
</head>
<body>
<div class="jumbotron">
<h1>Angular Price Format</h1>
<p>A Jquery Price Format Directive for AngularJS</p>
<p>
<a class="btn btn-primary btn-lg" href="https://github.com/Finance-e/angular-price-format" role="button"><i class="fa fa2x fa-github"></i> GitHub Project</a>
<a class="btn btn-primary btn-lg" href="#examples" role="button">Examples</a>
</p>
</div>
<div class='container container-fluid center-block col-lg-12'>
<div id="install">
<h2>Installation</h2>
<p>Install bower dependence</p>
<pre>bower install angular-price-format</pre>
</div>
<div id="usage">
<h2>Basic Usage</h2>
<p>You must include angularjs, jquery and angular-price-format scripts: </p>
<pre><script src="bower_components/jquery/dist/jquery.min.js"></script><br/><script src="bower_components/angular/angular.min.js"></script><br/><script src="dist/angular-price-format.min.js"></script></pre>
<p>Create your controller with some proprety (include angular-price-format dependence) </p>
<pre><script>
angular.module('myModule', ['angular-price-format']).
controller('priceFormatCTRL', ['$scope', function($scope) {
$scope.test = 0;
}]);<br/></script></pre>
</div>
<div ng-app="priceFormat" id='examples'>
<h2>Examples</h2>
<div ng-controller="priceFormatCTRL" class="center-block">
<div class='example col-lg-12'>
<h3>Simple Example</h3>
<pre><input id='ex1' type="text" class='form-control' ng-model="test" pformat/></pre>
<div class="form_item form-group col-lg-5 col-sm-12">
<label for="ex1" id="lex1" class="control-label caption"><span>Live Demo</span></label>
<input id='ex1' type="text" class='form-control' ng-model="test" pformat/>
<div>Result: <span>{{test}}</span></div>
</div>
</div>
<div class='example col-lg-12'>
<h3>Easy javascript number manipulation</h3>
<pre><input id='ex2' type="text" class='form-control' ng-model="test2" pformat prefix="" cents='.' thousands=''/></pre>
<div class="form_item form-group col-lg-5 col-sm-12">
<label for="ex2" id="lex2" class="control-label caption"><span>Live Demo</span></label>
<input id='ex2' type="text" class='form-control' ng-model="test2" pformat prefix="" cents='.' thousands=''/>
<div>Result: <span>{{test2}}</span></div>
</div>
</div>
<div class='example col-lg-12'>
<h3>Country currency</h3>
<pre><input id='ex3' type="text" class='form-control' ng-model="test3" pformat prefix="R$ " cents=',' thousands='.'/></pre>
<div class="form_item form-group col-lg-5 col-sm-12">
<label for="ex3" id="lex3" class="control-label caption"><span>Live Demo</span></label>
<input id='ex3' type="text" class='form-control' ng-model="test3" pformat prefix="R$ " cents=',' thousands='.'/>
<div>Result: <span>{{test3}}</span></div>
</div>
</div>
<div class='example col-lg-12'>
<h3>Number Limits</h3>
<pre><input id='ex4' type="text" class='form-control' ng-model="test4" pformat decimals='5' limit="10"/></pre>
<div class="form_item form-group col-lg-5 col-sm-12">
<label for="ex4" id="lex4" class="control-label caption"><span>Live Demo</span></label>
<input id='ex4' type="text" class='form-control' ng-model="test4" pformat decimals="5" limit="10"/>
<div>Result: <span>{{test4}}</span></div>
</div>
</div>
<div class='example col-lg-12'>
<h3>Negative option</h3>
<pre><input id='ex5' type="text" class='form-control' ng-model="test5" pformat negative="true"/></pre>
<div class="form_item form-group col-lg-5 col-sm-12">
<label for="ex5" id="lex5" class="control-label caption"><span>Live Demo</span></label>
<input id='ex5' type="text" class='form-control' ng-model="test5" pformat negative="true"/>
<div>Result: <span>{{test5}}</span></div>
</div>
</div>
<div class='example col-lg-12'>
<h3>Plus Sign option</h3>
<pre><input id='ex6' type="text" class='form-control' ng-model="test6" pformat plus="true"/></pre>
<div class="form_item form-group col-lg-5 col-sm-12">
<label for="ex6" id="lex6" class="control-label caption"><span>Live Demo</span></label>
<input id='ex6' type="text" class='form-control' ng-model="test6" pformat plus="true"/>
<div>Result: <span>{{test6}}</span></div>
</div>
</div>
<div class='example col-lg-12'>
<h3>Decimals with more than two numbers</h3>
<pre><input id='ex7' type="text" class='form-control' ng-model="test7" pformat decimals="6"/></pre>
<div class="form_item form-group col-lg-5 col-sm-12">
<label for="ex7" id="lex7" class="control-label caption"><span>Live Demo</span></label>
<input id='ex7' type="text" class='form-control' ng-model="test7" pformat decimals="6"/>
<div>Result: <span>{{test7}}</span></div>
</div>
</div>
</div>
</div>
</div>
<hr/>
<div class='col-lg-12'>
<div class="container">
<div class="row">
<p class="pull-left">© <a href="http://www.finance-e.com" target="_blank">Finance-e</a> 2014</p>
</div>
</div>
</div>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="js/jquery-price-format.js"></script>
<script src="js/angular-price-format.js"></script>
<script>
angular.module('priceFormat', ['angular-price-format']).
controller('priceFormatCTRL', ['$scope', function($scope) {
$scope.test = 0;
$scope.test2 = 0;
$scope.test3 = 0;
$scope.test4 = 0;
$scope.test5 = -2;
$scope.test6 = 2;
$scope.test7 = 0.0000006;
}]);
</script>
</body>
</html>