feat: update hotel service to use observables
All checks were successful
Build / Build and analyze (push) Successful in 1m41s
All checks were successful
Build / Build and analyze (push) Successful in 1m41s
This commit is contained in:
parent
5e739e63e7
commit
26ea503cbd
3 changed files with 11 additions and 20 deletions
|
@ -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
|
||||
}
|
||||
];
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue