forked from JMontagu/ng-AustralianBusinessNumber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
129 lines (122 loc) · 4.13 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en" ng-app="ngAbnDemo">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AngularJS Australian Business Number (ABN) Directive</title>
<!-- <link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet"> -->
<link href="http://bootswatch.com/flatly/bootstrap.min.css" rel="stylesheet">
<style>
ul.list-group li:hover {
background-color: #ecf0f1;
cursor: pointer;
text-decoration: underline;
}
</style>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container" ng-controller="demoCtrl">
<header>
<div class="row">
<div class="col-lg-12">
<div class="jumbotron">
<h1 id="type">AngularJS ABN Validation</h1>
<p class="lead">Australian Business Number (ABN) AngularJS input validation directive. Uses the ATO validation formula.</p>
<p>Usage: <code><input ng-model="abnNumber" abn /></code></p>
<a href="https://github.com/JMontagu/ng-AustralianBusinessNumber" class="btn btn-primary btn-lg">Get the code</a>
</div>
</div>
</div>
</header>
<section>
<div class="row">
<div class="col-lg-12">
<h2>Enter an ABN, or tap an example below</h2>
</div>
<div class="col-lg-6">
<div class="well">
<form name="form" role="form">
<div class="form-group" ng-class="{'has-success': form.abnInput.$valid, 'has-error': form.abnInput.$error}">
<label for="abnInput" class="control-label">ABN</label>
<input id="abnInput" class="form-control" name="abnInput" ng-model="abnNumber" placeholder="Australian Business Number" abn />
<span class="help-block" ng-show="form.abnInput.$error.abn">✖ Invalid ABN</span>
</div>
</form>
</div>
</div>
<div class="col-lg-4">
<ul class="list-group">
<li ng-repeat="i in demoABNItems" ng-click="copyToInput(i.abn)" class="list-group-item">
<span class="badge">{{i.name}}</span>
{{i.abn}}
</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Demo markup</h2>
<pre><form name="form" role="form">
<div class="form-group" ng-class="{'has-success': form.abnInput.$valid, 'has-error': form.abnInput.$error}">
<label for="abnInput" class="control-label">ABN</label>
<input id="abnInput" class="form-control" name="abnInput" ng-model="abnNumber" placeholder="Australian Business Number" abn />
<span class="help-block" ng-show="form.abnInput.$error.abn">✖ Invalid ABN</span>
</div>
</form>
</pre>
</div>
</div>
</section>
<footer>
<div class="row">
<div class="col-lg-12">
<p>Built by <a href="http://jademontagu.com">Jade Montagu</a></p>
</div>
</div>
</footer>
</div>
<script src="bower_components/angular/angular.min.js"></script>
<script src="src/australianBusinessNumber.js"></script>
<script>
var ngAbnDemo = angular.module("ngAbnDemo", ['australianBusinessNumber'])
.constant('demoABNItems', [
{
name: 'Invalid ABN',
abn: '12 345 678 910'
},
{
name: 'Text',
abn: 'ishouldnotwork'
},
{
name: 'Partial ABN',
abn: '53 004 085'
},
{
name: 'ATO Sample ABN',
abn: '53 004 085 616'
},
{
name: 'Telstra',
abn: '33 051 775 556'
},
{
name: 'Google Australia',
abn: '33 102 417 032'
}
])
.controller('demoCtrl', ['$scope', 'demoABNItems', function($scope, demoABNItems) {
$scope.abnNumber = '';
$scope.demoABNItems = demoABNItems;
$scope.copyToInput = function(abn) {
$scope.abnNumber = abn;
};
}]);
</script>
</body>
</html>