forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.validator.date.html
41 lines (40 loc) · 1.11 KB
/
angular.validator.date.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
<h1>angular.validator.date</h1>
<fieldset class="workInProgress">
<legend>Work In Progress</legend>
This page is currently being revised. It might be incomplete or contain inaccuracies.
</fieldset>
<h2>Description</h2>
<p>Use date validator to restrict the user input to a valid date
in format in format MM/DD/YYYY.</p>
<h2>Usage</h2>
<h3>In HTML Template Binding</h3>
<tt>
<input type="text" ng:validate="date"/>
</tt>
<h3>In JavaScript</h3>
<tt ng:non-bindable>
angular.validator.date(value);
</tt>
<h3>Parameters</h3>
<ul>
<li><tt>value</tt> –
<tt>{string}</tt>
<tt></tt>
– value to validate</li>
</ul>
<h3>CSS</h3>
ng-validation-error
<h2>Example</h2>
<doc:example>
<doc:source>
Enter valid date:
<input name="text" value="1/1/2009" ng:validate="date" >
</doc:source>
<doc:scenario>it('should invalidate date', function(){
var n1 = element('.doc-example :input');
expect(n1.attr('className')).not().toMatch(/ng-validation-error/);
input('text').enter('123/123/123');
expect(n1.attr('className')).toMatch(/ng-validation-error/);
});
</doc:scenario>
</doc:example>