feat: The available chatrooms are fetched and displayed in a component
[demos/kafka/chat] / src / app / chatroom.service.ts
1 import { Injectable } from '@angular/core';
2 import { HttpClient } from "@angular/common/http";
3 import { Observable, of } from "rxjs";
4 import { Chatroom } from "./chatroom";
5
6 @Injectable({
7   providedIn: 'root'
8 })
9 export class ChatroomService {
10
11   private uriList = 'http://localhost:8080/list';
12
13   constructor(private http: HttpClient) { }
14
15   getChatrooms(): Observable<Chatroom[]> {
16     return this.http.get<Chatroom[]>(this.uriList);
17   }
18 }