mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
save
This commit is contained in:
@@ -90,6 +90,7 @@
|
||||
|
||||
</ion-list>
|
||||
</div>
|
||||
<button (click)="sendMsg()">Send message</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Aside right -->
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user