summaryrefslogtreecommitdiff
path: root/sample-apps
diff options
context:
space:
mode:
Diffstat (limited to 'sample-apps')
-rw-r--r--sample-apps/angular-chat/src/app/app.component.html6
-rw-r--r--sample-apps/angular-chat/src/app/app.component.ts4
2 files changed, 9 insertions, 1 deletions
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 @@
<div>
+ Chat Room directory:
+ <ul>
+ <li *ngFor="let room of (directory$ | async)">
+ {{room}}
+ </li>
+ </ul>
<form>
<label>Username</label>
<input type="text" name="user-id" [(ngModel)]="userId" />
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<ChatMessage[]>
+ directory$: Observable<string[]>
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)
}
}