1 import { Component, OnInit } from '@angular/core';
2 import { Chatroom } from '../chatroom';
3 import { UserService } from "../user.service";
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[] = [];
16 private chatroomsService: ChatroomService,
17 private userService: UserService) {}
21 this.userService.assertUserisKnown(() => this.getChatrooms());
24 getChatrooms(): void {
27 .subscribe(chatrooms => this.chatrooms = chatrooms);