Browse Source

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

pull/6927/head
KenTandrian 2 days ago
parent
commit
98063526f1
  1. 21
      apps/client/src/app/components/home-overview/home-overview.component.ts

21
apps/client/src/app/components/home-overview/home-overview.component.ts

@ -23,6 +23,7 @@ import {
Component, Component,
CUSTOM_ELEMENTS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA,
DestroyRef, DestroyRef,
inject,
OnInit OnInit
} from '@angular/core'; } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@ -63,15 +64,17 @@ export class GfHomeOverviewComponent implements OnInit {
public unit: string; public unit: string;
public user: User; public user: User;
public constructor( private readonly changeDetectorRef = inject(ChangeDetectorRef);
private changeDetectorRef: ChangeDetectorRef, private readonly dataService = inject(DataService);
private dataService: DataService, private readonly destroyRef = inject(DestroyRef);
private destroyRef: DestroyRef, private readonly deviceDetectorService = inject(DeviceDetectorService);
private deviceDetectorService: DeviceDetectorService, private readonly impersonationStorageService = inject(
private impersonationStorageService: ImpersonationStorageService, ImpersonationStorageService
private layoutService: LayoutService, );
private userService: UserService private readonly layoutService = inject(LayoutService);
) { 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