Browse Source

feat(client): replace constructor based DI with inject functions

pull/7302/head
KenTandrian 3 days ago
parent
commit
8c963bf174
  1. 32
      apps/client/src/app/components/user-account-settings/user-account-settings.component.ts

32
apps/client/src/app/components/user-account-settings/user-account-settings.component.ts

@ -20,11 +20,13 @@ import {
Component, Component,
CUSTOM_ELEMENTS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA,
DestroyRef, DestroyRef,
inject,
OnInit OnInit
} from '@angular/core'; } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { import {
FormBuilder, FormBuilder,
FormGroup,
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
Validators Validators
@ -73,9 +75,7 @@ export class GfUserAccountSettingsComponent implements OnInit {
protected baseCurrency: string; protected baseCurrency: string;
protected closeUserAccountMail: string; protected closeUserAccountMail: string;
protected currencies: string[] = []; protected currencies: string[] = [];
protected deleteOwnUserForm = this.formBuilder.group({ protected deleteOwnUserForm: FormGroup;
accessToken: ['', Validators.required]
});
protected hasPermissionToDeleteOwnUser: boolean; protected hasPermissionToDeleteOwnUser: boolean;
protected hasPermissionToRequestOwnUserDeletion: boolean; protected hasPermissionToRequestOwnUserDeletion: boolean;
protected hasPermissionToUpdateViewMode: boolean; protected hasPermissionToUpdateViewMode: boolean;
@ -104,17 +104,21 @@ export class GfUserAccountSettingsComponent implements OnInit {
]; ];
protected user: User; protected user: User;
public constructor( private changeDetectorRef = inject(ChangeDetectorRef);
private changeDetectorRef: ChangeDetectorRef, private dataService = inject(DataService);
private dataService: DataService, private destroyRef = inject(DestroyRef);
private destroyRef: DestroyRef, private formBuilder = inject(FormBuilder);
private formBuilder: FormBuilder, private notificationService = inject(NotificationService);
private notificationService: NotificationService, private settingsStorageService = inject(SettingsStorageService);
private settingsStorageService: SettingsStorageService, private snackBar = inject(MatSnackBar);
private snackBar: MatSnackBar, private userService = inject(UserService);
private userService: UserService, private webAuthnService = inject(WebAuthnService);
private webAuthnService: WebAuthnService
) { public constructor() {
this.deleteOwnUserForm = this.formBuilder.group({
accessToken: ['', Validators.required]
});
const { baseCurrency, currencies } = this.dataService.fetchInfo(); const { baseCurrency, currencies } = this.dataService.fetchInfo();
this.baseCurrency = baseCurrency; this.baseCurrency = baseCurrency;

Loading…
Cancel
Save