diff options
Diffstat (limited to 'frontend/src/app/app.component.ts')
-rw-r--r-- | frontend/src/app/app.component.ts | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index 59f247ed..f9bc2726 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { AfterViewInit, Component, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; import { filter, map } from 'rxjs'; @@ -11,9 +11,12 @@ import Shared from './Shared'; templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) -export class AppComponent implements OnInit { +export class AppComponent implements OnInit, AfterViewInit { + constructor(private router: Router, private titleService: Title, private authService: AuthService, private signalRService: SignalRService, private http: HttpClient) { - constructor(private router: Router, private titleService: Title,private authService:AuthService,private signalRService:SignalRService,private http:HttpClient) { } + } + ngAfterViewInit(): void { + } ngOnInit() { this.router.events @@ -36,23 +39,10 @@ export class AppComponent implements OnInit { this.titleService.setTitle(`${title} - Igrannonica`); } }); - if(!this.authService.isAuthenticated()) - { - this.authService.addGuestToken(); - } - this.signalRService.startConnection(); - //this.startHttpRequest(); - - - - - } - private startHttpRequest = () => { - this.http.get('http://localhost:5283/chatHub') - .subscribe(res => { - console.log(res); - }) + if (!this.authService.isAuthenticated()) { + this.authService.addGuestToken(); + } + this.signalRService.startConnection(); + //this.startHttpRequest(); } - - } |