Add connecting WebSocketService to each component

This commit is contained in:
Kristóf Tóth 2018-02-16 12:12:01 +01:00
parent 80de695fa1
commit e42d831138
2 changed files with 1 additions and 1 deletions

View File

@ -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);

View File

@ -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();
} }