Browse Source

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

pull/6921/head
KenTandrian 4 days ago
parent
commit
036ec1bbef
  1. 15
      apps/client/src/app/components/home-market/home-market.component.ts

15
apps/client/src/app/components/home-market/home-market.component.ts

@ -18,6 +18,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';
@ -47,13 +48,13 @@ export class GfHomeMarketComponent implements OnInit {
private readonly info: InfoItem; private readonly info: InfoItem;
public constructor( private readonly changeDetectorRef = inject(ChangeDetectorRef);
private readonly changeDetectorRef: ChangeDetectorRef, private readonly dataService = inject(DataService);
private readonly dataService: DataService, private readonly destroyRef = inject(DestroyRef);
private readonly destroyRef: DestroyRef, private readonly deviceDetectorService = inject(DeviceDetectorService);
private readonly deviceDetectorService: DeviceDetectorService, private readonly userService = inject(UserService);
private readonly userService: UserService
) { public constructor() {
this.deviceType = this.deviceDetectorService.getDeviceInfo().deviceType; this.deviceType = this.deviceDetectorService.getDeviceInfo().deviceType;
this.info = this.dataService.fetchInfo(); this.info = this.dataService.fetchInfo();

Loading…
Cancel
Save