mirror of
				https://github.com/avatao-content/frontend-tutorial-framework
				synced 2025-11-04 06:22:56 +00:00 
			
		
		
		
	Add connecting WebSocketService to each component
This commit is contained in:
		@@ -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();
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user