From 036ec1bbef5d11da0709e809a9dc93b229780e90 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Fri, 22 May 2026 10:54:37 +0700 Subject: [PATCH] feat(client): replace constructor based DI with inject function --- .../home-market/home-market.component.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/client/src/app/components/home-market/home-market.component.ts b/apps/client/src/app/components/home-market/home-market.component.ts index da1b94f4e..02c3d7197 100644 --- a/apps/client/src/app/components/home-market/home-market.component.ts +++ b/apps/client/src/app/components/home-market/home-market.component.ts @@ -18,6 +18,7 @@ import { Component, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, + inject, OnInit } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; @@ -47,13 +48,13 @@ export class GfHomeMarketComponent implements OnInit { private readonly info: InfoItem; - public constructor( - private readonly changeDetectorRef: ChangeDetectorRef, - private readonly dataService: DataService, - private readonly destroyRef: DestroyRef, - private readonly deviceDetectorService: DeviceDetectorService, - private readonly userService: UserService - ) { + private readonly changeDetectorRef = inject(ChangeDetectorRef); + private readonly dataService = inject(DataService); + private readonly destroyRef = inject(DestroyRef); + private readonly deviceDetectorService = inject(DeviceDetectorService); + private readonly userService = inject(UserService); + + public constructor() { this.deviceType = this.deviceDetectorService.getDeviceInfo().deviceType; this.info = this.dataService.fetchInfo();