1 import { Component, OnInit } from '@angular/core';
2 import { FormsModule } from '@angular/forms';
3 import { Chatroom } from '../chatroom';
4 import { ChatroomService } from "../chatroom.service";
7 selector: 'app-chatrooms',
8 templateUrl: './chatrooms.component.html',
9 styleUrls: ['./chatrooms.component.less']
11 export class ChatroomsComponent implements OnInit
13 chatrooms: Chatroom[] = [];
15 constructor(private chatroomsService: ChatroomService) { }
22 getChatrooms(): void {
25 .subscribe(chatrooms => this.chatrooms = chatrooms);