Browse Source

feat(client): migrate to inject function

pull/6731/head
KenTandrian 1 month ago
parent
commit
566a3654a0
  1. 21
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts

21
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts

@ -27,7 +27,7 @@ import {
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
DestroyRef, DestroyRef,
Inject, inject,
OnInit OnInit
} from '@angular/core'; } from '@angular/core';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@ -104,15 +104,16 @@ export class GfAccountDetailDialogComponent implements OnInit {
public user: User; public user: User;
public valueInBaseCurrency: number; public valueInBaseCurrency: number;
public constructor( private readonly changeDetectorRef = inject(ChangeDetectorRef);
private changeDetectorRef: ChangeDetectorRef, private readonly data = inject<AccountDetailDialogParams>(MAT_DIALOG_DATA);
@Inject(MAT_DIALOG_DATA) public data: AccountDetailDialogParams, private readonly dataService = inject(DataService);
private dataService: DataService, private readonly destroyRef = inject(DestroyRef);
private destroyRef: DestroyRef, private readonly dialogRef =
public dialogRef: MatDialogRef<GfAccountDetailDialogComponent>, inject<MatDialogRef<GfAccountDetailDialogComponent>>(MatDialogRef);
private router: Router, private readonly router = inject(Router);
private userService: UserService private readonly userService = inject(UserService);
) {
public constructor() {
this.userService.stateChanged this.userService.stateChanged
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((state) => { .subscribe((state) => {

Loading…
Cancel
Save