From 7d3d9737ffdaf1b8d354ddadad32cd5878ae8061 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Sun, 17 May 2026 11:37:26 +0700 Subject: [PATCH] feat(client): migrate constructor based DI to inject function --- .../admin-overview.component.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/apps/client/src/app/components/admin-overview/admin-overview.component.ts b/apps/client/src/app/components/admin-overview/admin-overview.component.ts index afb837f90..90cb01436 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.component.ts +++ b/apps/client/src/app/components/admin-overview/admin-overview.component.ts @@ -30,6 +30,7 @@ import { ChangeDetectorRef, Component, DestroyRef, + inject, OnInit } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; @@ -101,17 +102,17 @@ export class GfAdminOverviewComponent implements OnInit { private info: InfoItem; - public constructor( - private adminService: AdminService, - private cacheService: CacheService, - private changeDetectorRef: ChangeDetectorRef, - private clipboard: Clipboard, - private dataService: DataService, - private destroyRef: DestroyRef, - private notificationService: NotificationService, - private snackBar: MatSnackBar, - private userService: UserService - ) { + private readonly adminService = inject(AdminService); + private readonly cacheService = inject(CacheService); + private readonly changeDetectorRef = inject(ChangeDetectorRef); + private readonly clipboard = inject(Clipboard); + private readonly dataService = inject(DataService); + private readonly destroyRef = inject(DestroyRef); + private readonly notificationService = inject(NotificationService); + private readonly snackBar = inject(MatSnackBar); + private readonly userService = inject(UserService); + + public constructor() { this.info = this.dataService.fetchInfo(); this.userService.stateChanged