Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngOnInit() {
const onMessageSent$ = new BroadcastEventListener('OnMessageSent');
this._connection.listen(onMessageSent$);
this._subscription = onMessageSent$.subscribe((chatMessage: ChatMessage) => {
this.chatMessages.push(chatMessage);
console.log('chat messages', this.chatMessages);
});
}