Skip to content

Commit f3fcfce

Browse files
committed
fix(demo): removed unwanted code
1 parent 75654b7 commit f3fcfce

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

demo/src/app/home/home.component.ts

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {AfterViewInit, ChangeDetectionStrategy, Component, OnInit, ViewChild, ViewEncapsulation} from '@angular/core';
1+
import {ChangeDetectionStrategy, Component, OnInit, ViewChild, ViewEncapsulation} from '@angular/core';
22
import {Title} from '@angular/platform-browser';
33
import {MatPasswordStrengthComponent} from '@angular-material-extensions/password-strength';
4-
import {FormControl, FormGroup} from '@angular/forms';
4+
import {FormControl} from '@angular/forms';
55

66
@Component({
77
selector: 'app-home',
@@ -10,12 +10,11 @@ import {FormControl, FormGroup} from '@angular/forms';
1010
encapsulation: ViewEncapsulation.None,
1111
changeDetection: ChangeDetectionStrategy.OnPush
1212
})
13-
export class HomeComponent implements OnInit, AfterViewInit {
13+
export class HomeComponent implements OnInit {
1414

1515
@ViewChild('passwordComponentWithValidation')
1616
passwordComponentWithValidation2: MatPasswordStrengthComponent;
1717

18-
formGroup: FormGroup;
1918
passwordFormControl: FormControl;
2019
x: FormControl;
2120

@@ -37,11 +36,6 @@ export class HomeComponent implements OnInit, AfterViewInit {
3736
console.log('home on init');
3837
this.titleService.setTitle('Home | mat-password-strength');
3938

40-
this.formGroup = new FormGroup({
41-
'password': this.passwordComponentWithValidation2.passwordFormControl,
42-
'confirmPass': this.passwordComponentWithValidation2.passwordConfirmationFormControl,
43-
}, this.passwordComponentWithValidation2.checkPasswords);
44-
4539
this.passwordComponentWithValidation2.passwordFormControl.valueChanges.subscribe(() => {
4640
console.log('passwordFormControl form control = ', this.passwordComponentWithValidation2.passwordFormControl);
4741
});
@@ -56,23 +50,5 @@ export class HomeComponent implements OnInit, AfterViewInit {
5650
// console.log('password strength = ', strength);
5751
}
5852

59-
ngAfterViewInit(): void {
60-
// console.log('pass comp on ngAfterViewInit', this.passwordComponentWithValidation2);
61-
}
62-
63-
// validate(): ValidatorFn {
64-
// const validator = (control: AbstractControl): { [key: string]: any } => {
65-
// // this.isUndefinedOrEmpty(control);
66-
// console.log('validate', !RegExpValidator.lowerCase.test(control.value));
67-
// // control.setErrors({test: true});
68-
// if (!RegExpValidator.lowerCase.test(control.value)) {
69-
// return {
70-
// 'lowerCase': true
71-
// };
72-
// }
73-
// return undefined;
74-
// };
75-
// return validator;
76-
// }
7753

7854
}

0 commit comments

Comments
 (0)