@@ -58,40 +58,37 @@ <h1>@angular-material-extensions/password-strength</h1>
5858 </ mat-tab-group >
5959 </ mat-card-content >
6060
61- < mat-card-subtitle fxLayout ="row " fxLayoutGap ="10px ">
62- < mat-slide-toggle (change) ="onSlideToggleChange($event) "> Show Password</ mat-slide-toggle >
61+ < mat-card-subtitle >
6362 < mat-slide-toggle [(ngModel)] ="showDetails "> Show Password Details</ mat-slide-toggle >
6463 </ mat-card-subtitle >
6564
6665 < mat-card-content >
67- < div >
68-
69- <!--password input filed-->
70- < mat-form-field appearance ="outline " style ="width: 100% " [color] ="passwordComponent.color ">
71- < mat-label > Password</ mat-label >
72- < input matInput #password
73- [type] ="inputType "
74- required
75- placeholder ="Password ">
76- < mat-hint align ="end " aria-live ="polite ">
77- {{password.value.length}} / 25
78- </ mat-hint >
79- </ mat-form-field >
80-
81- <!--@angular-material-extensions/password-strength's main component-->
82- < mat-password-strength #passwordComponent
83- [enableDigitRule] ="true "
84- (onStrengthChanged) ="onStrengthChanged($event) "
85- [password] ="password.value ">
86- </ mat-password-strength >
87-
88- <!--Password's strength info-->
89- < mat-password-strength-info
90- *ngIf ="showDetails "
91- [passwordComponent] ="passwordComponent ">
92- </ mat-password-strength-info >
93-
94- </ div >
66+ <!--password input filed-->
67+ < mat-form-field appearance ="outline " style ="width: 100% " [color] ="passwordComponent.color ">
68+ < mat-label > Password</ mat-label >
69+ < mat-pass-toggle-visibility #toggle matSuffix > </ mat-pass-toggle-visibility >
70+ < input matInput #password
71+ [type] ="toggle.type "
72+ required
73+ placeholder ="Password ">
74+ < mat-hint align ="end " aria-live ="polite ">
75+ {{password.value.length}} / 25
76+ </ mat-hint >
77+ </ mat-form-field >
78+
79+ <!--@angular-material-extensions/password-strength's main component-->
80+ < mat-password-strength #passwordComponent
81+ [enableDigitRule] ="true "
82+ (onStrengthChanged) ="onStrengthChanged($event) "
83+ [password] ="password.value ">
84+ </ mat-password-strength >
85+
86+ <!--Password's strength info-->
87+ < mat-password-strength-info
88+ *ngIf ="showDetails "
89+ [passwordComponent] ="passwordComponent ">
90+ </ mat-password-strength-info >
91+
9592 </ mat-card-content >
9693 </ mat-card >
9794 </ div >
@@ -113,8 +110,7 @@ <h1>@angular-material-extensions/password-strength</h1>
113110 < mat-card-subtitle >
114111 client side password validation with angular form controller
115112 </ mat-card-subtitle >
116- < mat-card-subtitle fxLayout ="row " fxLayoutGap ="10px ">
117- < mat-slide-toggle (change) ="onSlideToggleChange($event) "> Show Password</ mat-slide-toggle >
113+ < mat-card-subtitle >
118114 < mat-slide-toggle [(ngModel)] ="showDetails2 "> Show Password Details</ mat-slide-toggle >
119115 </ mat-card-subtitle >
120116
@@ -138,8 +134,9 @@ <h1>@angular-material-extensions/password-strength</h1>
138134 <!--password input filed-->
139135 < mat-form-field appearance ="outline " style ="width: 100% ">
140136 < mat-label > Password</ mat-label >
137+ < mat-pass-toggle-visibility #toggle2 matSuffix > </ mat-pass-toggle-visibility >
141138 < input matInput #passwordWithValidation
142- [type] ="inputType "
139+ [type] ="toggle2.type "
143140 required
144141 [formControl] ="passwordComponentWithValidation.passwordFormControl "
145142 placeholder ="Password ">
0 commit comments