Browse Source

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

pull/7286/head
KenTandrian 5 days ago
parent
commit
2395ed9aa8
  1. 19
      apps/client/src/app/components/user-account-membership/user-account-membership.component.ts

19
apps/client/src/app/components/user-account-membership/user-account-membership.component.ts

@ -13,7 +13,8 @@ import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
DestroyRef DestroyRef,
inject
} from '@angular/core'; } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
@ -54,14 +55,14 @@ export class GfUserAccountMembershipComponent {
private couponId: string | undefined; private couponId: string | undefined;
private priceId: string; private priceId: string;
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 notificationService = inject(NotificationService);
private readonly notificationService: NotificationService, private readonly snackBar = inject(MatSnackBar);
private readonly snackBar: MatSnackBar, private readonly userService = inject(UserService);
private readonly userService: UserService
) { public constructor() {
const { baseCurrency, globalPermissions } = this.dataService.fetchInfo(); const { baseCurrency, globalPermissions } = this.dataService.fetchInfo();
this.baseCurrency = baseCurrency; this.baseCurrency = baseCurrency;

Loading…
Cancel
Save