diff options
author | Danijel Anđelković <adanijel99@gmail.com> | 2022-04-13 22:14:47 +0200 |
---|---|---|
committer | Danijel Anđelković <adanijel99@gmail.com> | 2022-04-13 22:14:47 +0200 |
commit | a8c050790da92cb0b0bf4a0ca4e4fbea17eacc2e (patch) | |
tree | 2ee15de1055c4860b0c8ab4e666218f90fb31804 /frontend/src/app/_services/signal-r.service.ts | |
parent | 27f41c923c8142a2e71d390fc73e8c6baa52a734 (diff) |
Dodao hvatanje notifikacija o treniranoj epohi / procesovanom datasetu na frontendu.
Diffstat (limited to 'frontend/src/app/_services/signal-r.service.ts')
-rw-r--r-- | frontend/src/app/_services/signal-r.service.ts | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/frontend/src/app/_services/signal-r.service.ts b/frontend/src/app/_services/signal-r.service.ts index 5eca48d3..2a6e5d78 100644 --- a/frontend/src/app/_services/signal-r.service.ts +++ b/frontend/src/app/_services/signal-r.service.ts @@ -6,25 +6,23 @@ import { CookieService } from 'ngx-cookie-service'; providedIn: 'root' }) export class SignalRService { -private hubConnection?:signalR.HubConnection; -public startConnection=()=>{ + public hubConnection?: signalR.HubConnection; + public startConnection = () => { - this.hubConnection= new signalR.HubConnectionBuilder() - .withUrl('http://localhost:5283/chatHub', { - accessTokenFactory: () => this.cookie.get("token"), - withCredentials: false - }).build(); + this.hubConnection = new signalR.HubConnectionBuilder() + .withUrl('http://localhost:5283/chatHub', { + accessTokenFactory: () => this.cookie.get("token"), + withCredentials: false + }).build(); - this.hubConnection.on("Notify",(message:string) =>{ - console.log(" "+message); - }); + this.hubConnection.on("Notify", (message: string) => { + console.log(" " + message); + }); - - - this.hubConnection - .start() - .then(()=>console.log("con Started")) - .catch(err=>console.log("Error"+err)) -} - constructor(private cookie:CookieService) { } + this.hubConnection + .start() + .then(() => console.log("con Started")) + .catch(err => console.log("Error" + err)) + } + constructor(private cookie: CookieService) { } } |