Browse Source

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

pull/7292/head
KenTandrian 5 days ago
parent
commit
3cbc897d1a
  1. 28
      apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts

28
apps/client/src/app/components/user-detail-dialog/user-detail-dialog.component.ts

@ -9,7 +9,7 @@ import {
Component, Component,
CUSTOM_ELEMENTS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA,
DestroyRef, DestroyRef,
Inject, inject,
OnInit OnInit
} from '@angular/core'; } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@ -51,7 +51,8 @@ import {
export class GfUserDetailDialogComponent implements OnInit { export class GfUserDetailDialogComponent implements OnInit {
protected baseCurrency: string; protected baseCurrency: string;
protected readonly getCountryName = getCountryName; protected readonly getCountryName = getCountryName;
protected readonly subscriptionsDataSource = new MatTableDataSource<Subscription>(); protected readonly subscriptionsDataSource =
new MatTableDataSource<Subscription>();
protected readonly subscriptionsDisplayedColumns = [ protected readonly subscriptionsDisplayedColumns = [
'createdAt', 'createdAt',
'type', 'type',
@ -60,17 +61,18 @@ export class GfUserDetailDialogComponent implements OnInit {
]; ];
protected user: AdminUserResponse; protected user: AdminUserResponse;
public constructor( protected readonly data = inject<UserDetailDialogParams>(MAT_DIALOG_DATA);
private adminService: AdminService,
private changeDetectorRef: ChangeDetectorRef, private readonly adminService = inject(AdminService);
@Inject(MAT_DIALOG_DATA) public data: UserDetailDialogParams, private readonly changeDetectorRef = inject(ChangeDetectorRef);
private dataService: DataService, private readonly dataService = inject(DataService);
private destroyRef: DestroyRef, private readonly destroyRef = inject(DestroyRef);
public dialogRef: MatDialogRef< private readonly dialogRef =
GfUserDetailDialogComponent, inject<MatDialogRef<GfUserDetailDialogComponent, UserDetailDialogResult>>(
UserDetailDialogResult MatDialogRef
> );
) {
public constructor() {
this.baseCurrency = this.dataService.fetchInfo().baseCurrency; this.baseCurrency = this.dataService.fetchInfo().baseCurrency;
addIcons({ addIcons({

Loading…
Cancel
Save