projects
/
demos
/
kafka
/
chat
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: Added a chatroom component, that is navigatable by the chatroom's ID
[demos/kafka/chat]
/
src
/
app
/
chatrooms
/
chatrooms.component.ts
diff --git
a/src/app/chatrooms/chatrooms.component.ts
b/src/app/chatrooms/chatrooms.component.ts
index
c965cf9
..
26665da
100644
(file)
--- a/
src/app/chatrooms/chatrooms.component.ts
+++ b/
src/app/chatrooms/chatrooms.component.ts
@@
-1,6
+1,6
@@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
-import { FormsModule } from '@angular/forms';
import { Chatroom } from '../chatroom';
import { Chatroom } from '../chatroom';
+import { UserService } from "../user.service";
import { ChatroomService } from "../chatroom.service";
@Component({
import { ChatroomService } from "../chatroom.service";
@Component({
@@
-8,15
+8,17
@@
import { ChatroomService } from "../chatroom.service";
templateUrl: './chatrooms.component.html',
styleUrls: ['./chatrooms.component.less']
})
templateUrl: './chatrooms.component.html',
styleUrls: ['./chatrooms.component.less']
})
-export class ChatroomsComponent
implements OnInit
+export class ChatroomsComponent implements OnInit
{
chatrooms: Chatroom[] = [];
{
chatrooms: Chatroom[] = [];
- constructor(private chatroomsService: ChatroomService) { }
+ constructor(
+ private chatroomsService: ChatroomService,
+ private userService: UserService) {}
ngOnInit(): void
{
ngOnInit(): void
{
- this.
getChatrooms(
);
+ this.
userService.assertUserisKnown(() => this.getChatrooms()
);
}
getChatrooms(): void {
}
getChatrooms(): void {