- newPassword = '';
- newConfirmedPassword = '';
- changePasswordForm: FormGroup;
- information: string = null;
- error: string = null;
-
- constructor(
- private accountService: AccountService,
- private router: Router
- ) {}
-
- ngOnInit() {
- this.changePasswordForm = new FormGroup({
- 'new-password': new FormControl('', [ <any>Validators.required, <any>Validators.minLength(6) ]),
- 'new-confirmed-password': new FormControl('', [ <any>Validators.required, <any>Validators.minLength(6) ]),
- });
- }
-
- changePassword() {
- this.information = null;
- this.error = null;
-
- if (this.newPassword !== this.newConfirmedPassword) {
- this.error = 'The new password and the confirmed password do not correspond.';
- return;
- }