mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 05:11:56 +00:00
Add connecting WebSocketService to each component
This commit is contained in:
parent
80de695fa1
commit
e42d831138
@ -21,6 +21,7 @@ export class MessagesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.websocketService.connect();
|
||||||
this.websocketService.observeAnchor<Message>('message').subscribe(
|
this.websocketService.observeAnchor<Message>('message').subscribe(
|
||||||
(event) => {
|
(event) => {
|
||||||
this.messages.push(event.data);
|
this.messages.push(event.data);
|
||||||
|
@ -42,7 +42,6 @@ export class WebideComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.webSocketService.connect();
|
this.webSocketService.connect();
|
||||||
this.webSocketService.send('reset', '');
|
|
||||||
this.subscribeWS();
|
this.subscribeWS();
|
||||||
this.requestCode();
|
this.requestCode();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user