mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-06-29 07:15:12 +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);
|
||||
|
Reference in New Issue
Block a user