Browse Source

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

pull/6913/head
KenTandrian 6 days ago
parent
commit
acbccbfe91
  1. 27
      apps/client/src/app/components/header/header.component.ts

27
apps/client/src/app/components/header/header.component.ts

@ -29,6 +29,7 @@ import {
DestroyRef, DestroyRef,
EventEmitter, EventEmitter,
HostListener, HostListener,
inject,
Input, Input,
OnChanges, OnChanges,
Output, Output,
@ -120,18 +121,20 @@ export class GfHeaderComponent implements OnChanges {
protected readonly routerLinkRegister = publicRoutes.register.routerLink; protected readonly routerLinkRegister = publicRoutes.register.routerLink;
protected readonly routerLinkResources = publicRoutes.resources.routerLink; protected readonly routerLinkResources = publicRoutes.resources.routerLink;
public constructor( private readonly dataService = inject(DataService);
private readonly dataService: DataService, private readonly destroyRef = inject(DestroyRef);
private readonly destroyRef: DestroyRef, private readonly dialog = inject(MatDialog);
private readonly dialog: MatDialog, private readonly impersonationStorageService = inject(
private readonly impersonationStorageService: ImpersonationStorageService, ImpersonationStorageService
private readonly layoutService: LayoutService, );
private readonly notificationService: NotificationService, private readonly layoutService = inject(LayoutService);
private readonly router: Router, private readonly notificationService = inject(NotificationService);
private readonly settingsStorageService: SettingsStorageService, private readonly router = inject(Router);
private readonly tokenStorageService: TokenStorageService, private readonly settingsStorageService = inject(SettingsStorageService);
private readonly userService: UserService private readonly tokenStorageService = inject(TokenStorageService);
) { private readonly userService = inject(UserService);
public constructor() {
this.impersonationStorageService this.impersonationStorageService
.onChangeHasImpersonation() .onChangeHasImpersonation()
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))

Loading…
Cancel
Save