1 import { Component, OnInit } from '@angular/core';
2 import { ActivatedRoute } from '@angular/router';
3 import { ChatroomService } from "../chatroom.service";
4 import { UserService } from "../user.service";
5 import { Chatroom } from "../chatroom";
8 selector: 'app-chatroom',
9 templateUrl: './chatroom.component.html',
10 styleUrls: ['./chatroom.component.less']
12 export class ChatroomComponent implements OnInit {
14 chatroom: Chatroom = { id: 'FOO', name: 'BAR'};
17 private chatroomsService: ChatroomService,
18 private userService: UserService,
19 private route: ActivatedRoute) {}
23 this.userService.assertUserisKnown(() => this.getChatroom());
27 const id: string | null = this.route.snapshot.paramMap.get('id');
29 console.log("ID for chatroom is missing in URI");
34 .subscribe(chatroom => this.chatroom = chatroom);