-
Notifications
You must be signed in to change notification settings - Fork 3
/
pass-code.component.html
79 lines (70 loc) · 2.28 KB
/
pass-code.component.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
<div class="showcase">
<span class="demo__case__title">Text code - required + upercase</span>
<ngx-pass-code
[formControl]="textCodeControl"
type="text"
[length]="5"
[uppercase]="true"
[autofocus]="true"
></ngx-pass-code>
<div class="showcase__values">
<span>Current value: {{ textCodeControl.value | json }}</span>
<span
>Value changes: {{ textCodeControl.valueChanges | async | json }}</span
>
<span>Valid: {{ textCodeControl.valid }}</span>
</div>
<div class="showcase__actions">
<button (click)="textCodeControl.reset(); textCodeControl.enable()">
Reset
</button>
<button (click)="textCodeControl.disable()">Disable</button>
<button (click)="textCodeControl.patchValue('ACAB7')">Patch</button>
</div>
</div>
<div class="showcase">
<span class="showcase__title">Numbers code</span>
<ngx-pass-code
[length]="5"
[autoblur]="true"
type="number"
[formControl]="numberCodeControl"
></ngx-pass-code>
<div class="showcase__values">
<span>Current value: {{ numberCodeControl.value | json }}</span>
<span
>Value changes: {{ numberCodeControl.valueChanges | async | json }}</span
>
<span>Valid: {{ numberCodeControl.valid }}</span>
</div>
<div class="showcase__actions">
<button (click)="numberCodeControl.reset(); numberCodeControl.enable()">
Reset
</button>
<button (click)="numberCodeControl.disable()">Disable</button>
<button (click)="numberCodeControl.patchValue(216582)">Patch</button>
</div>
</div>
<div class="showcase">
<span class="showcase__title">Password (hidden) code</span>
<ngx-pass-code
[length]="7"
type="password"
[formControl]="passwordCodeControl"
></ngx-pass-code>
<div class="showcase__values">
<span>Current value: {{ passwordCodeControl.value | json }}</span>
<span
>Value changes:
{{ passwordCodeControl.valueChanges | async | json }}</span
>
<span>Valid: {{ passwordCodeControl.valid }}</span>
</div>
<div class="showcase__actions">
<button (click)="passwordCodeControl.reset(); passwordCodeControl.enable()">
Reset
</button>
<button (click)="passwordCodeControl.disable()">Disable</button>
<button (click)="passwordCodeControl.patchValue('my')">Patch</button>
</div>
</div>