-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
92 lines (80 loc) · 2.6 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
<!doctype html>
<html lang="en" ng-app="demo">
<head>
<meta charset="UTF-8">
<title>Angular CVR validator demo</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<style>
*{
box-sizing: border-box;
}
body{
font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
}
.container{
width: 400px;
margin: 100px auto;
text-align: center;
}
.back{
position: fixed;
top:5px;
right:5px;
}
input{
display: block;
outline: 0;
width: 100%;
border: solid 1px #ccc;
padding: 10px 20px;
font-size: 16px;
}
input:focus{
border-color: #333;
}
input.ng-invalid.ng-dirty{
border-color:#f00;
}
.form-error{
text-align: left;
margin-top: 10px;
color:#f00;
}
.form-error.warning{
color: inherit;
}
</style>
</head>
<body>
<div class="container">
<a class="back" href="https://github.com/crisbeto/angular-cvr-validator">Back to project repo</a>
<form ng-submit="" novalidate name="form">
<h1>Validate a CVR number</h1>
<input
type="text"
name="cvr"
ng-model="cvr"
placeholder="Input a CVR number"
validate-cvr>
<div class="form-error" ng-show="form.cvr.$dirty && form.cvr.$invalid">This is not a valid CVR number</div>
<div class="form-error warning" ng-show="form.cvr.$warning">CVR number seems valid but we couldn't find in the public registry</div>
<div class="form-error warning" ng-if="form.cvr.$cvrData">
<div>This CVR belongs to:</div>
<ul>
<li>{{ form.cvr.$cvrData.name }}</li>
<li>{{ form.cvr.$cvrData.address }}</li>
<li>{{ form.cvr.$cvrData.zipcode }}</li>
<li>{{ form.cvr.$cvrData.city }}</li>
<li>{{ form.cvr.$cvrData.email }}</li>
<li>{{ form.cvr.$cvrData.phone }}</li>
</ul>
</div>
</form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.js"></script>
<script src="cvr.min.js"></script>
<script>
angular.module('demo', ['angular-cvr-validator']);
</script>
</body>
</html>