import { Injectable } from '@angular/core' ; import { Http , Response } from '@angular/http' ; import { Observable } from 'rxjs/Observable' ; declare var signalR ; import { HubConnection } from '@aspnet/signalr-client' ; import { environment } from './../../../environments' ; /**
* This class provides the SignalR service with methods to read names and add names.
*/ @ Injectable ( ) export class SignalRService { onlineHubUrl = environment . serverUrl ; constructor ( ) { } connectOnlineHub ( ) { const connection = new signalR . HubConnection ( `${ this . onlineHubUrl }/onlinehub` ) ; return connection ; } }