forked from hueitan/angular-validation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.html
212 lines (176 loc) · 7.76 KB
/
main.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html lang="en" ng-app="bsDemo">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="distribution" content="global" />
<meta name="author" content="Huei Tan" />
<meta name="publisher" content="Huei Tan" />
<meta name="rating" content="general" />
<meta name="robots" content="all" />
<meta name="spiders" content="all" />
<meta name="webcrawlers" content="all" />
<meta name="company" content="angular-validation" />
<meta name="abstract" content="Client-side Validation for AngularJS" />
<meta name="subject" content="angular-validation" />
<meta name="description" content="Client-side Validation for AngularJS" />
<meta name="keywords" content="angular","angularjs","validation","angular validation","validator","client-side" />
<meta property="og:title" content="angular-validation" />
<meta property="og:url" content="http://huei90.github.io/angular-validation/" />
<meta property="og:description" content="Client-side Validation for AngularJS" />
<meta property="og:image" content="//avatars0.githubusercontent.com/u/2560096?v=3&s=460" />
<title>Angular Validation</title>
<!-- Bootstrap core CSS -->
<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="bower_components/bootstrap/dist/css/bootstrap-theme.min.css" rel="stylesheet">
<link rel="stylesheet" href="demo/main.css"/>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.min.js"></script>
<script src="dist/angular-validation.js"></script>
<script src="dist/angular-validation-rule.js"></script>
<script src="demo/bsDemo.js"></script>
</head>
<body role="document" ng-controller="bsDemoCtrl">
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Angular Validation</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#getting_started">Getting started</a></li>
<li><a href="#contact">Report an issue</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<header class="bs-docs-header" tabindex="-1">
<div class="container">
<h1>Angular Validation</h1>
<div class="bs-docs-decs">
<p> Client-side Validation should be simple and clean. </p>
<p>Don't let Client-side Validation dirty your controller. </p>
<p>Setup your Validation on config phase by using some rules (example) <p>
<p>If you prefer schema over html attributes , try angular-validation-schema (Demo)
And add Validation in your view only.
</p>
</div>
</div>
</header>
<div class="container theme-showcase" role="main">
<!-- Main jumbotron for a primary marketing message or call to action -->
<section id="getting_started">
<div class="hidden-xs" style="height: 40px;"></div>
<div class="page-header">
<h1>Getting Started</h1>
</div>
<h3>Requirements</h3>
<br/>
<p><strong> AngularJS 1.2.x </strong>(for angular-validation 1.2.x)</p>
<p><strong> AngularJS 1.3.x </strong>(for angular-validation 1.3.x)</p>
<h3>Installation</h3>
<br/>
<p>Install with npm</p>
<pre>
<code>
npm install angular-validation
</code>
</pre>
<p>Or with Bower</p>
<pre>
<code>
bower install angular-validation
</code>
</pre>
<br/>
<h3>Files to download</h3>
<br/>
<p>Add the files to your html</p>
<pre>
<code>
<script src="dist/angular-validation.js"></script>
<script src="dist/angular-validation-rule.js"></script>
</code>
</pre>
<p>If you are using Bower: </p>
<pre>
<code>
<script src="lib/angular-validation/dist/angular-validation.js"></script>
<script src="lib/angular-validation/dist/angular-validation-rule.js"></script>
</code>
</pre>
<pre>
<code>
angular.module('yourApp', ['validation']);
</code>
</pre>
<p>Including your validation rule</p>
<pre>
<code>
angular.module('yourApp', ['validation', 'validation.rule']);
</code>
</pre>
<br/>
<h3>Writing your first code</h3>
<pre>
<code>
<form name="Form">
<div class="row">
<div>
<label>Required</label>
<input type="text" name="required" ng-model="form.required" validator="required">
</div>
<div>
<label>Url</label>
<input type="text" name="url" ng-model="form.url" validator="required, url">
</div>
<button validation-submit="Form" ng-click="next()">Submit</button>
<button validation-reset="Form">Reset</button>
</div>
</form>
</code>
</pre>
</section>
<div class="page-header">
<h1>UI Bootstrap Examples</h1>
</div>
<h4>Date picker</h4>
<div>
<form name="Form">
<fieldset>
<legend>Getting Started</legend>
<div>
<label>Required</label>
<p class="input-group">
<input type="text" class="form-control" uib-datepicker-popup="dd-MMMM-yyyy" ng-model="dt" is-open="status.opened" datepicker-options="dateOptions" close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
<button validation-submit="Form" ng-click="next()">Submit</button>
<button validation-reset="Form">Reset</button>
</fieldset>
</form>
</div>
<div class="page-header">
</div>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
</body>
</html>