Skip to content

Commit

Permalink
Use inject instead of constructor injection
Browse files Browse the repository at this point in the history
  • Loading branch information
cremertim committed Nov 29, 2024
1 parent 5f2e030 commit 59294fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/webapp/app/faq/faq.routes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable } from '@angular/core';
import { Injectable, inject } from '@angular/core';
import { HttpResponse } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
import { Observable, of } from 'rxjs';
Expand All @@ -8,7 +8,7 @@ import { Faq } from 'app/entities/faq.model';

@Injectable({ providedIn: 'root' })
export class FaqResolve implements Resolve<Faq> {
constructor(private faqService: FaqService) {}
protected faqService = inject(FaqService);

resolve(route: ActivatedRouteSnapshot): Observable<Faq> {
const faqId = route.params['faqId'];
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/app/faq/faq.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable } from '@angular/core';
import { Injectable, inject } from '@angular/core';
import { HttpClient, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
Expand All @@ -12,7 +12,7 @@ type EntityArrayResponseType = HttpResponse<Faq[]>;
export class FaqService {
public resourceUrl = 'api/courses';

constructor(protected http: HttpClient) {}
private http = inject(HttpClient);

create(courseId: number, faq: Faq): Observable<EntityResponseType> {
const copy = FaqService.convertFaqFromClient(faq);
Expand Down

0 comments on commit 59294fd

Please sign in to comment.