1 import { Injectable } from '@angular/core';
2 import { HttpClient } from "@angular/common/http";
3 import { Observable, of } from "rxjs";
4 import { Chatroom } from "./chatroom";
9 export class ChatroomService {
11 private uriList = 'http://localhost:8080/list';
12 private uriGet = 'http://localhost:8080/get/';
14 constructor(private http: HttpClient) { }
16 getChatrooms(): Observable<Chatroom[]> {
17 return this.http.get<Chatroom[]>(this.uriList);
20 getChatroom(id: String): Observable<Chatroom> {
21 return this.http.get<Chatroom>(this.uriGet + id);