Skip to content

Commit 2563522

Browse files
committed
demo(app): added an appropriate example to #149
1 parent 644ee12 commit 2563522

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

demo/src/app/examples/examples.component.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,48 @@ <h1>Explore the library and try these examples <3</h1>
188188
</mat-card>
189189
</mat-card>
190190

191+
<!-- #4 -->
192+
<mat-card class="mt-4">
193+
<mat-card-title>#4</mat-card-title>
194+
<mat-card-subtitle>stand alone password component with already provided value
195+
</mat-card-subtitle>
196+
197+
<mat-slide-toggle #toggle5>Show Password Details</mat-slide-toggle>
198+
199+
<mat-card-content>
200+
<!--password input filed-->
201+
<mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent5.color">
202+
<mat-label>Password</mat-label>
203+
<input matInput #password5
204+
type="password"
205+
value="2Am.;!#019s'"
206+
placeholder="Password">
207+
<mat-hint align="end" aria-live="polite">
208+
{{password5.value.length}} / {{passwordComponent5.max}}
209+
</mat-hint>
210+
</mat-form-field>
211+
212+
<!--@angular-material-extensions/password-strength's main component-->
213+
<mat-password-strength #passwordComponent5
214+
(onStrengthChanged)="onStrengthChanged($event)"
215+
[password]="password5.value">
216+
</mat-password-strength>
217+
<!--Password's strength info-->
218+
<mat-password-strength-info
219+
*ngIf="toggle5.checked"
220+
[passwordComponent]="passwordComponent5"
221+
[enableScoreInfo]="true">
222+
</mat-password-strength-info>
223+
</mat-card-content>
224+
225+
<mat-card class="mt-2">
226+
<mat-card-title>code</mat-card-title>
227+
<mat-card-content>
228+
<markdown src="assets/md/examples/e5.md"></markdown>
229+
</mat-card-content>
230+
</mat-card>
231+
</mat-card>
232+
233+
191234
</div>
192235
</section>

demo/src/assets/md/examples/e5.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
```html
2+
<mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent.color">
3+
<mat-label>Password</mat-label>
4+
<input matInput #password
5+
type="password"
6+
value="2Am.;!#019s'"
7+
placeholder="Password">
8+
<mat-hint align="end" aria-live="polite">
9+
{{password.value.length}} / {{passwordComponent.max}}
10+
</mat-hint>
11+
</mat-form-field>
12+
13+
14+
<mat-password-strength #passwordComponent
15+
(onStrengthChanged)="onStrengthChanged($event)"
16+
[password]="password.value">
17+
</mat-password-strength>
18+
```

0 commit comments

Comments
 (0)