From c973da44da1ede938a6b4dfb712226992cc76bbe Mon Sep 17 00:00:00 2001 From: Nick Van Doorn Date: Mon, 4 Mar 2019 01:57:27 -0800 Subject: Add chat room directory to app component --- sample-apps/angular-chat/src/app/app.component.html | 6 ++++++ sample-apps/angular-chat/src/app/app.component.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sample-apps/angular-chat/src/app/app.component.html b/sample-apps/angular-chat/src/app/app.component.html index 1e28015..ec6739b 100644 --- a/sample-apps/angular-chat/src/app/app.component.html +++ b/sample-apps/angular-chat/src/app/app.component.html @@ -1,4 +1,10 @@
+ Chat Room directory: +
diff --git a/sample-apps/angular-chat/src/app/app.component.ts b/sample-apps/angular-chat/src/app/app.component.ts index 8048476..02a1f9e 100644 --- a/sample-apps/angular-chat/src/app/app.component.ts +++ b/sample-apps/angular-chat/src/app/app.component.ts @@ -14,11 +14,13 @@ export class AppComponent { userId: string = '' chatRoomId: string messages$: Observable + directory$: Observable messageBuff: string constructor(private messaging: MessagingService) {} ngOnInit() { this.messaging.init() + this.directory$ = this.messaging.getDirectory() } sendMessage() { @@ -26,7 +28,7 @@ export class AppComponent { } async makeChatRoom() { - this.chatRoomId = await this.messaging.makeChatRoom(this.userId) + this.chatRoomId = await this.messaging.makeChatRoom() this.messages$ = this.messaging.getChatRoom(this.chatRoomId) } } -- cgit v1.2.3