From 3cbc897d1a812c2a144cf015314749019006a1ea Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Thu, 9 Jul 2026 23:28:49 +0700 Subject: [PATCH] feat(client): replace constructor based DI with inject functions --- .../user-detail-dialog.component.ts | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts index 92e25c944..e0d8415ce 100644 --- a/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts +++ b/apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts @@ -9,7 +9,7 @@ import { Component, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, - Inject, + inject, OnInit } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; @@ -51,7 +51,8 @@ import { export class GfUserDetailDialogComponent implements OnInit { protected baseCurrency: string; protected readonly getCountryName = getCountryName; - protected readonly subscriptionsDataSource = new MatTableDataSource(); + protected readonly subscriptionsDataSource = + new MatTableDataSource(); protected readonly subscriptionsDisplayedColumns = [ 'createdAt', 'type', @@ -60,17 +61,18 @@ export class GfUserDetailDialogComponent implements OnInit { ]; protected user: AdminUserResponse; - public constructor( - private adminService: AdminService, - private changeDetectorRef: ChangeDetectorRef, - @Inject(MAT_DIALOG_DATA) public data: UserDetailDialogParams, - private dataService: DataService, - private destroyRef: DestroyRef, - public dialogRef: MatDialogRef< - GfUserDetailDialogComponent, - UserDetailDialogResult - > - ) { + protected readonly data = inject(MAT_DIALOG_DATA); + + private readonly adminService = inject(AdminService); + private readonly changeDetectorRef = inject(ChangeDetectorRef); + private readonly dataService = inject(DataService); + private readonly destroyRef = inject(DestroyRef); + private readonly dialogRef = + inject>( + MatDialogRef + ); + + public constructor() { this.baseCurrency = this.dataService.fetchInfo().baseCurrency; addIcons({