Skip to content

Commit

Permalink
Simplify inject() typing #10706
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Oct 3, 2024
1 parent 3433614 commit cd39a7a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions client/app/admin/users/services/user.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {gql} from 'apollo-angular';
import {Injectable, OnDestroy, inject} from '@angular/core';
import {inject, Injectable, OnDestroy} from '@angular/core';
import {FormControl, ValidationErrors, Validators} from '@angular/forms';
import {Router} from '@angular/router';
import {
Expand All @@ -12,7 +12,6 @@ import {
LOCAL_STORAGE,
NaturalAbstractModelService,
NaturalQueryVariablesManager,
NaturalStorage,
unique,
} from '@ecodev/natural';
import {fromEvent, Observable, of, Subject} from 'rxjs';
Expand Down Expand Up @@ -109,7 +108,7 @@ export class UserService
protected readonly bookingService = inject(BookingService);
private readonly permissionsService = inject(PermissionsService);
protected readonly pricedBookingService = inject(PricedBookingService);
private readonly storage = inject<NaturalStorage>(LOCAL_STORAGE);
private readonly storage = inject(LOCAL_STORAGE);

/**
* Should be used only by getViewer and cacheViewer
Expand Down
3 changes: 1 addition & 2 deletions client/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
NaturalIconDirective,
NaturalSidenavContainerComponent,
NaturalSidenavStackService,
NaturalStorage,
} from '@ecodev/natural';
import {filter, switchMap} from 'rxjs/operators';
import {ActivatedRoute, Router, RouterLink, RouterOutlet} from '@angular/router';
Expand Down Expand Up @@ -36,7 +35,7 @@ import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
export class HomeComponent implements OnInit {
private readonly userService = inject(UserService);
private readonly router = inject(Router);
private readonly storage = inject<NaturalStorage>(LOCAL_STORAGE);
private readonly storage = inject(LOCAL_STORAGE);
public readonly route = inject(ActivatedRoute);
private readonly configurationService = inject(ConfigurationService);
private readonly naturalSidenavStackService = inject(NaturalSidenavStackService);
Expand Down
2 changes: 1 addition & 1 deletion client/app/profile/components/bvr/bvr.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const queryForExport = gql`
})
export class BvrComponent {
private readonly apollo = inject(Apollo);
private readonly document = inject<Document>(DOCUMENT);
private readonly document = inject(DOCUMENT);

@Input() public set bankingData(data: BankingInfosVariables) {
this.variables = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type ContactType = 'bookingsWithOwnerContact' | 'emailAndPhoneUsers';
})
export class CopyContactDataButtonService<V extends EmailAndPhoneUsersVariables | BookingsWithOwnerContactVariables> {
private readonly apollo = inject(Apollo);
private readonly document = inject<Document>(DOCUMENT);
private readonly document = inject(DOCUMENT);

private type!: ContactType;
private variablesManager!: NaturalQueryVariablesManager<V>;
Expand Down
2 changes: 1 addition & 1 deletion client/app/shared/services/datatrans.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function stringifyReplacer(key: string, value: unknown): unknown {
providedIn: 'root',
})
export class DatatransService {
private readonly document = inject<Document>(DOCUMENT);
private readonly document = inject(DOCUMENT);

private preservedStyles: {html: string; body: string} = {html: '', body: ''};
private paymentFrame: HTMLDivElement | null = null;
Expand Down

0 comments on commit cd39a7a

Please sign in to comment.