-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to validate with reactive forms #281
Labels
Comments
AnthonyNahas
added
enhancement
New feature or request
PR WELCOME <3
Pull Requests are welcome with love <3
labels
Jun 17, 2020
In the next version, I am supporting reactive forms! Here is an example: <mat-password-strength formControlName="password"
[password]="password.value">
</mat-password-strength> import {Component, OnInit} from '@angular/core';
import {FormControl, FormGroup} from '@angular/forms';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
passwordFormGroup: FormGroup;
ngOnInit() {
this.passwordFormGroup = new FormGroup({
password: new FormControl()
});
this.passwordFormGroup
.get('password')
.valueChanges
.subscribe(value => console.log('Reactive Forms --> password value (strength 0-100) -->', value));
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Hello, How to validate password field with reactive forms?
The text was updated successfully, but these errors were encountered: