Ajout du modèle Car et du composant permettant de l'afficher.

This commit is contained in:
Florian THIERRY
2023-02-21 11:48:27 +01:00
parent 48ff32a30b
commit 95fb661d7a
11 changed files with 126 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {Car} from "../model/car";
import {toPromise} from "../utils/promises.utils";
@Injectable({
providedIn: 'root'
})
export class CarRestService {
constructor(
private http: HttpClient
) { }
findById(carId: string): Promise<Car> {
return toPromise(this.http.get<Car>(`/cars/${carId}`));
}
}