feat: update hotel service to use observables
All checks were successful
Build / Build and analyze (push) Successful in 1m41s

This commit is contained in:
Jan K9f 2024-10-22 07:31:11 +02:00
parent 5e739e63e7
commit 26ea503cbd
Signed by: jank
GPG key ID: B267751B8AE29EFE
3 changed files with 11 additions and 20 deletions

View file

@ -1,10 +1,11 @@
import { Injectable } from "@angular/core";
import { Hotel } from "../../HotelItem/hotel";
import { from, Observable } from "rxjs";
@Injectable()
export class HotelService {
public getHotels(): Hotel[] {
return [
public getHotels(): Observable<Hotel> {
return from([
{
"hotelId": 1,
"hotelName": "Buea süßes Leben",
@ -37,6 +38,6 @@ export class HotelService {
"imageUrl": "assets/img/4.jpg",
"rating": 2.5
}
];
]);
}
}