Update Password Page Component
class UpdatePasswordPageComponent
update-password-page.component.ts
import { NgOptimizedImage } from '@angular/common';
import { Component, inject, OnDestroy, OnInit } from '@angular/core';
import {
AbstractControl,
FormBuilder,
FormControl,
FormGroup,
ReactiveFormsModule,
ValidationErrors,
ValidatorFn,
Validators,
} from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatTooltipModule } from '@angular/material/tooltip';
import { Router } from '@angular/router';
import { AlertService } from '@jet/services/alert/alert.service';
import { LoggerService } from '@jet/services/logger/logger.service';
import { ProgressBarService } from '@jet/services/progress-bar/progress-bar.service';
import { UserService } from '@jet/services/user/user.service';
import { TranslocoModule, TranslocoService } from '@jsverse/transloco';
import { Subscription } from 'rxjs';
import { PageComponent } from '../page/page.component';
@Component({
imports: [
NgOptimizedImage,
ReactiveFormsModule,
MatButtonModule,
MatCardModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatTooltipModule,
TranslocoModule,
PageComponent,
],
selector: 'jet-update-password-page',
styleUrl: './update-password-page.component.scss',
templateUrl: './update-password-page.component.html',
})
export class UpdatePasswordPageComponent implements OnInit, OnDestroy {
private readonly _formBuilder = inject(FormBuilder);
private readonly _router = inject(Router);
private readonly _alertService = inject(AlertService);
private readonly _loggerService = inject(LoggerService);
private readonly _progressBarService = inject(ProgressBarService);
private readonly _userService = inject(UserService);
private readonly _translocoService = inject(TranslocoService);
private _newPasswordFormControlSubscription: Subscription;
public isConfirmNewPasswordHidden: boolean;
public isNewPasswordHidden: boolean;
public isUpdatePasswordPending: boolean;
public readonly updatePasswordFormGroup: FormGroup<{
confirmNewPassword: FormControl<string | null>;
newPassword: FormControl<string | null>;
}>;
public constructor() {
// Buy to unlock
}
public ngOnInit(): void {
// Buy to unlock
}
public ngOnDestroy(): void {
// Buy to unlock
}
public async updatePassword(password: string): Promise<void> {
// Buy to unlock
}
private _matchFormControlValidator(
newPasswordControl: AbstractControl,
): ValidatorFn {
// Buy to unlock
}
}
Last updated
Was this helpful?