- 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;
- }
-
- this.accountService.changePassword(this.newPassword).subscribe(
- ok => this.information = 'Password updated.',
-
- err => this.error = err
- );