How to use the ng2-signalr.BroadcastEventListener function in ng2-signalr

To help you get started, we’ve selected a few ng2-signalr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TrilonIO / aspnetcore-angular-universal / ClientApp / app / containers / chat / chat.component.ts View on Github external
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);
      });
    }