This commit is contained in:
tiago.kayaya
2021-05-19 09:37:43 +01:00
parent 6997295a31
commit 0f60f237b1
9 changed files with 23 additions and 17 deletions
+1
View File
@@ -90,6 +90,7 @@
</ion-list>
</div>
<button (click)="sendMsg()">Send message</button>
</div>
</div>
<!-- Aside right -->
+6 -3
View File
@@ -101,9 +101,7 @@ export class ChatPage implements OnInit {
private resolver: ComponentFactoryResolver,
){
this.headers = new HttpHeaders();
chatService.messages.subscribe(msg => {
console.log("Response from websocket: " + msg);
});
this.loadMessage();
}
ngOnInit() {
@@ -120,6 +118,11 @@ export class ChatPage implements OnInit {
/* Fim websocket functions */
}
loadMessage(){
this.chatService.messages.subscribe(msg => {
console.log("Response from websocket: " + msg);
});
}
sendMsg() {
console.log("new message from client to websocket: ", this.message);
this.chatService.messages.next(this.message);