mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 02:51:57 +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() {
|
||||
this.websocketService.connect();
|
||||
this.websocketService.observeAnchor<Message>('message').subscribe(
|
||||
(event) => {
|
||||
this.messages.push(event.data);
|
||||
|
@ -42,7 +42,6 @@ export class WebideComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.webSocketService.connect();
|
||||
this.webSocketService.send('reset', '');
|
||||
this.subscribeWS();
|
||||
this.requestCode();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user