From acbccbfe91875e0c5d0edfe9938e1b4213dc03e4 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Wed, 20 May 2026 10:12:39 +0700 Subject: [PATCH] feat(client): replace constructor based DI with inject function --- .../app/components/header/header.component.ts | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/apps/client/src/app/components/header/header.component.ts b/apps/client/src/app/components/header/header.component.ts index e493bc609..9fb8ef217 100644 --- a/apps/client/src/app/components/header/header.component.ts +++ b/apps/client/src/app/components/header/header.component.ts @@ -29,6 +29,7 @@ import { DestroyRef, EventEmitter, HostListener, + inject, Input, OnChanges, Output, @@ -120,18 +121,20 @@ export class GfHeaderComponent implements OnChanges { protected readonly routerLinkRegister = publicRoutes.register.routerLink; protected readonly routerLinkResources = publicRoutes.resources.routerLink; - public constructor( - private readonly dataService: DataService, - private readonly destroyRef: DestroyRef, - private readonly dialog: MatDialog, - private readonly impersonationStorageService: ImpersonationStorageService, - private readonly layoutService: LayoutService, - private readonly notificationService: NotificationService, - private readonly router: Router, - private readonly settingsStorageService: SettingsStorageService, - private readonly tokenStorageService: TokenStorageService, - private readonly userService: UserService - ) { + private readonly dataService = inject(DataService); + private readonly destroyRef = inject(DestroyRef); + private readonly dialog = inject(MatDialog); + private readonly impersonationStorageService = inject( + ImpersonationStorageService + ); + private readonly layoutService = inject(LayoutService); + private readonly notificationService = inject(NotificationService); + private readonly router = inject(Router); + private readonly settingsStorageService = inject(SettingsStorageService); + private readonly tokenStorageService = inject(TokenStorageService); + private readonly userService = inject(UserService); + + public constructor() { this.impersonationStorageService .onChangeHasImpersonation() .pipe(takeUntilDestroyed(this.destroyRef))